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
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
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
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
'unnecessary-comprehension' warning is emitted when
unnecessary use of a comprehension is found.
classes attribute in Action can be a tuple,
so we need list() to ensure it is a list before adding 'disabled'.
I think it is time to introduce a method in Action class or somewhere
but it should be handled separately.
Change-Id: I16a98d56b6d0bd0af234b00735c6ed576620df7e
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.
Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
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
"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
When user tries to attach a volume(multi-attach-volume) to
multiple instances "Manage Attachments" table shows wrong data.
This patch fix the issue.
Closes-Bug: #1700034
Part of blueprint multi-attach-volume
Co-Authored-By: Vishal Manchanda <manchandavishal143@gmail.com>
Change-Id: Ic84e3089c2c15e13dbdf89a38f867e3ddfed86d5
string_concat was removed in django 2.1 when it reached the end
of it's deprecation cycle. It was removed because the same behavior
can be achieved with format_lazy.
For more details see:
https://docs.djangoproject.com/en/2.2/releases/2.1/
Change-Id: I5e1c9bdfa1d0e049e0516198abbdb76be1667216
Closes-Bug: #1836671
Partial-Bug: #1789046
This commit mainly covers settings
in openstack_dashboard/dashboards/project/.
Part of blueprint ini-based-configuration
Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
Added functionality to the handle function in the BatchAction class
in action.py and allowed the easy changing between the alert types
and made deleting images, instances, and volumes give an info alert
rather than a success message and altered the testing parameters
Change-Id: I93251d6d12cf89a331b5c051bf4fe10a6e470f51
Closes-Bug: #1291681
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
The prior commit for this was functional but not quite
correct. The policy rules currently in Horizon for
attach and detach of volumes don't exist in Nova and
are missing from the local copy of nova_policy.json and
from Nova generated policy files. The fix to use the
create instance copy of the rule only worked for attach
and not detach ( https://review.openstack.org/#/c/570071/ )
This commit updates detach as well, and should be correct
going forward based on the Nova policy rules at:
https://git.openstack.org/cgit/openstack/nova/tree/nova/policies/volumes_attachments.py
Change-Id: I07fccd6f12149cd88a049c46aa113dfd2b60bbaa
Closes-bug: 1772759
The attach_volume rule on the Compute Instances and Volume pages
does not match the rule in the nova_policy.json file, or what is
generated from an oslo policy generation on Nova. Update the rule
to match what is used in the default policy file, and what Nova
uses in its unit tests.
While looking at this, discovered that the detach_volume has a
similar problem, with no rule that matches at all. It may make sense
to have detach volume use similar permissions to attach
Change-Id: I40c709c7bb0c8538b56624dbfff1faea2eba9ee6
Closes-bug: 1772759
Horizon don't have related change which align with the
change in https://review.openstack.org/#/c/330285.
With this fix, horizon can work as expected
Change-Id: I5940c662a0bec2beaf4863e07f7244311ba51212
Closes-Bug: #1770326
Signed-off-by: GUO Larry <guo1017138@163.com>
W503 line break before binary operator
Looking at the code base, it sounds okay to follow this check.
Change-Id: Id511e0104dc6de5b204021661d4a8776ca6d3658
(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
This scenario occurs when the associated VM instance with the volume is not found
by whatever underlying reasons.
Change-Id: I15831e2377fe504c667babe5ea00ac09808d296f
Closes-Bug: #1402915
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
In addition to "available" volumes, those that are "in-use" can now be
backed up. Backing up "in-use" volumes requires setting the "force"
parameter in the cinder backup call.
Closes-Bug: 1686671
Change-Id: I8a11216be49313f710ce5874499f8d2efba91e73
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.
After this, there are only 3 noqa under openstack_dashboard/ :)
Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
As Nova's API is unified to os_compute_api, the API policies are also
updated to use this format, Horizon needs to use Nova policy enforce
rules in the codebase. This patch also update nova_policy.json using
oslo-config-generator for Nova policy file.
Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>
Implements: blueprint update-nova-enforce-policies
Change-Id: Id7d01a39930c88592301a5035f0befe5293a78fa
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
Now that instance snapshots are just images, the images & snapshots
page only has images and volume snapshots. This is an odd combination.
I think we should now move volume snapshots to the volumes panel,
since a volume snapshot is tied to a volume.
Closes-Bug: #1190843
Change-Id: I3e12cec8b859a30db9f131e9889a92277e064086
Cinder now has the ablity to extend a volume, This functionality
should be exposed through Horizon.
Change-Id: Iff26453fd0a83af97fad4adabbcd53f646a15e51
Implements: blueprint volume-extend
Adding cinder policy rules file for policy checks. Implementing
rule checks as well. Some cinder API calls actually hit nova, so
adding those calls as well.
Also a couple of improvements to the Horizon policy engine. First,
now providing the token scope project_id and user_id as targets by
default, unless otherwise specified. Most service policy rules
check on or both of these. Second, checking to see if rule exists,
before attempting enforcement. If the rule does not exist, using
the default rule for that service. This now matches what the
service policy engines do.
Implements: blueprint block-rbac
Change-Id: Ifef08b8975280f4e621ba8eebec9d405e1e870a2
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.
I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.
I also removed a few unused imports that were revealed in the process.
Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
The cinder api allows calling snapshot on attached volumes,
we should enable it on horizon.
Change-Id: I33d7bbca0bf993ace7c243867aa5f57438a57a5d
Fixes: bug #1202929
Currently BatchAction message is generated by concatenating
'action' and 'data_type'. In most cases 'action' is a verb
and 'data_type' is an object. However in some action such as
TerminateInstance 'action' is a combination of verb and
object (e.g., "Scheduled termination of"). It is hard that
translators find translated strings which covers both cases.
This commit allows classes inheriting BatchAction to specify
a full action name containing '%(data_type)s' substitution
in action_present/ action_past so that translators can
control the order of phrases completely.
* _conjugate() in actions.py is renamed to _get_action_name()
because this method no longer always conjugate words.
* Changes action_past strings which are not a form of verb + obj
to strings with "%(data_type)s"
Closes-Bug: #1253678
Change-Id: I3cf1dc74e22745eb3a9bd2edc3ec68ed389495b5
In an effort to help horizon more friendly to OpenStack hacking
guidelines, we now gate on H40* violations.
Change-Id: Id07294543660368d2f7f5ac363710176ab23b874
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
User should be able to choose an AZ (or make unspecified) when creating a volume
AZ should be visible in Volumes table
AZ list should come from Cinder
Change-Id: I23314dedc3eb65454df32102b0a96174f8030d81
Closes-Bug: #1230288
In some files, we import logging and define
LOG, but we never used it later, so i remove
those unused LOG and make horizon code clean.
Fixed: bug #1231761
Change-Id: I1ebf0098c647e7522f5f1a93cfece7a52bdc05c1