Commit Graph

18 Commits

Author SHA1 Message Date
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
2022-02-04 16:22:07 +09:00
manchandavishal 6ac31e0ba8 Drop Django based implementation of launch instance
horizon already deprecated launch instance Django based implementation
in the wallaby cycle [1]. This patch remove code for launch instance
Django based implementation as angular based implementation is the
default one from long and all features gaps between angular and Django
implementation is closed.

It also moves SetAdvanced step code to ``resize_instance.py`` as
``workflows/create_instance.py`` file is deleted and remove server_group
option from Advanced Options of resizing instance action because
"server_group" is not required while resizing an instance as per
nova-api reference [2].

Closes-Bug: #1869222

[1] https://review.opendev.org/c/openstack/horizon/+/779125
[2] https://docs.openstack.org/api-ref/compute/?expanded=resize-server-resize-action-detail#resize-server-resize-action

Change-Id: I5e01cd81f309491f1a58ea93911030366a86e3c7
2022-01-24 16:21:18 +05:30
YuehuiLei 87f498bee5 Drop the usage of unicode prefix from unicode strings
All strings are considered as unicode strings in python 3,
so we no longer need "u" prefix (u'...').

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I796d2fcdca066475bbf29d25cbf2aa67b2b2178b
2021-02-12 13:05:27 -06:00
Akihiro Motoki e5d09edc20 Use python3-style super()
In python3, super() does not always require a class and self reference.
In other words, super() is enough for most cases.
This is much simpler and it is time to switch it to the newer style.

pylint provides a check for this.
Let's enable 'super-with-arguments' check.

NOTE: _prepare_mappings() method of FormRegion in
openstack_dashboard/test/integration_tests/regions/forms.py is refactored.
super() (without explicit class and self referece) does not work when
a subclass method calls a same method in a parent class multiple times.
It looks better to prepare a separate method to provide a common logic.

Change-Id: Id9512a14be9f20dbd5ebd63d446570c7b7c825ff
2020-10-15 14:37:20 +09:00
manchandavishal 79ff0d45c4 Add cinder-user-facing messages
This patch adds a tab for cinder user messages for volumes and
snapshots. Cinder user messages shows error details for cinder
resources like if we are unable to create a volume due to some
failure in cinder it will shows us the reason of failure.

Implements blueprint cinder-user-facing-messages

Change-Id: I6f1539ffebdf2dfd0a470009e9171e868c2a9ad3
2020-09-10 10:22:49 +00:00
Gayathri Devi Kathiri 423734b5ec Fix "Update Metadata" tab on Horizon
"Update Metadata" button is visible by all
roles on "Volumes" and "Snaphsots".

"policy_rules" is defined in "UpdateMetadata"
class to fix it.

Change-Id: Ibbdd4e4874c7cea97c91948003a68ebf43b8c934
closes-bug: #1873007
2020-04-20 10:13:49 +00:00
Jesper Schmitz Mouridsen 9fa1cddf09 Enable volume snapshot backups
Make it possible to use horizon for backing
up snapshots.

 * Add snapshot column to backups table
 * Add snapshot information to backup detail
 * Fix wrong template path in create_backup.html
 * Add ChoiceField with snapshots belonging
   to the volume in create backup form
 * Add create backup option in snapshots table
 * Adjust tests and test data

When backing up from snapshots table the snapshot
ChoiceField is preset with the choosen snapshot
as the only option.
Implements: blueprint volume-snapshot-backups

Change-Id: I4b7707d95756501e0622460e3ddc4e3f7624f02e
2019-07-25 19:15:01 +00:00
Akihiro Motoki fcdc67b819 Define default settings explicitly (openstack_dashboard 3/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/project/.

Part of blueprint ini-based-configuration
Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
2019-07-03 14:54:16 +09:00
Akihiro Motoki 0cb5167b99 Make project volume group table work even with volumev3 only env
Previously the volume group table in the project dashboard checked if
'volume' endpoint is available and 'volumev3' endpoint was not checked.
'volumev3' is an endpoint name commonly used for Volume v3 API and
it is not surprising that only volumev3 is configured in deployments,
so we should ensure that horizon works with environments only with
'volumev3' endpoint.

The service endpoints are already checked in panel.py, so there is no
need to have the permission check (i.e., service check) in the table.

Similar patterns are found in tables in project/snapshots and
project/vg_snapshots. They are also cleanup by this commit.

Change-Id: I12d03745bec5d8dec10a8e2b4306c595f2f39560
Closes-Bug: #1829461
2019-05-29 14:06:17 +00:00
Akihiro Motoki f3bd271fc9 pylint: fix bad-super-call
Change-Id: Ia81e5c8b77dbfcb48630b1736d581cdff73278ef
2019-01-15 01:11:33 +09:00
Akihiro Motoki e5d6f54e99 Make generic group check work with admin table
Previously allowed() methods in DeleteVolume and DeleteVolumeSnapshot
actions assume that the cinder generic group is always available.
The current admin volume and volume snapshot tables do not load
generic group information, so these allowed() methods failed and
as a result these delete actions are not shown.
This commit checks if a volume belongs to a generic group in more
robust way. This change makes the project volume table work with
deployments without the generic group as well.

Change-Id: Idd887434153966d9188acaf08346fa6a0f0e6719
Closes-Bug: #1787065
2018-08-15 01:52:10 +00:00
Akihiro Motoki ef4d8d69c9 Show generic group info in volume and volume snapshot pages
blueprint cinder-generic-volume-groups
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: I96515087a3e3a5328cceaff4e0e9a811601c7ba0
2018-07-03 13:24:24 +03:00
Akihiro Motoki e477eafa45 django2: Replace django.core.urlresolves with django.urls
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
2018-02-17 01:36:48 +09:00
Ivan Kolodyazhny a774fa30dd Use Cinder API v3 by default
Cinder API v3 was introduced several releases ago and is backward
compatible with API v2 so it's safe to swith to use it.

Change-Id: I550e6c59bb14c17da78d7b2abcde5783b2b6825d
Closes-Bug: #1728761
2017-12-18 15:34:41 +02:00
Lucas Palm a436b12acc Add the Snapshots tab on the Volume Details page
Currently, there is no way to filter and see the snapshots for
just a single Volume.  As the combined list of volume snapshots
increases, so does the difficulty in viewing and using them.  It
would be beneficial to have these snapshots isolated from each other
based on the volume they were created from.

This change adds a "Snapshots" tab to the Volume Details page that
shows a table of snapshots associated with only that specific Volume.
This will not only make it easier to just view the snapshots for a
particular Volume, but will also make it much more approachable to
manage and delete them as well.

Change-Id: I0a80ef2c8171c81f73e3abf5ab461dae3a3a9afe
Closes-Bug: #1323644
2017-07-27 13:30:34 +00:00
Timur Sufiev d2b1a9cbcc Remove unnecessary escaping of volume name
Variable contents in Django templates are escaped by default, no need
to do it explicitly.

Change-Id: I0b9619b7b1605bcdb17fe3b7204bf6e6c2520454
Closes-Bug: #1597751
2017-05-18 16:14:57 +04:00
Richard Jones 46ad19dbf0 Refactor Project Volumes stand-alone panel
Note that there was state leaking from one of the existing
tests that was relied upon in other tests and moving that test
in the run order caused the others to fail. All related tests
have been altered to not leak state.

Change-Id: I972bc5650fa77044de8a027f570cf2cb41febef8
Implements: blueprint reorganise-volumes
2017-03-06 15:50:09 +11:00
Richard Jones 97589ec0fb Move Volume snapshots out of tabbed panel
In doing this I found that the permission check on the
project Volume Snapshots table was incorrectly defined,
resulting in always-denied. Removing a level of nesting
in the permission structure fixed it.

Change-Id: I1bc5bd4820700d29861ec1dcd6c87a41b5230266
Implements: blueprint reorganise-volumes
2017-02-28 14:05:26 +11:00