HttpRequest.is_ajax() was marked as deprecated since Django 3.1 and will be
removed in Django 4.0 [1].
While the current implementation of is_ajax() relies on a jQuery-specific way
of signifying AJAX as noted in the Django relnotes, horizon works with this.
Thus this commit copies the existing logic of HttpRequest.is_ajax() to the
horizon repo (as horizon.utils.http.is_ajax()) and consumes it.
https: //docs.djangoproject.com/en/4.0/releases/3.1/#features-deprecated-in-3-1
Change-Id: I3def53033524985818a891a1b9d4659fad4ba2ba
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
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
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
The referenced bug has been fixed in all supported versions.
Change-Id: I0154dd99d83e6873660dc7edb9b40d02ba4e43f1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Per the Django 2.0 release notes [1]:
'django.shortcuts.render_to_response()' is deprecated in favor of
'django.shortcuts.render()'. 'render()' takes the same arguments
except that it also requires a request.
[1] https://docs.djangoproject.com/en/2.2/releases/2.0/#id1
Change-Id: I2b66a23df6b6f3f389054515fe948828ec5cba40
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This patch add "Group" column in Volume table and
"Group Snapshot" column in Volume snapshot table under
admin panel.
Change-Id: Ifa18c70be7d73b302e75ab451b1cd572d970b5c6
Now, one page content will be changed after Clicking
"Next page" or "Prev page" to go back.
As we know, the order of the list could not be changed
at will, for one at the beginning or the end is a marker.
The marker is very importent for pagination.
So, this commit remove the sort of snapshots and reverse
the sort of the previous page ones.
Change-Id: I8d3d0cf4a1e6526bed3055b18741b1cf5d6166ff
Closes-Bug: #1804391
In order to increase rendering speed, make
api.cinder.volume_list_paged, api.nova.server_list
and api.cinder.volume_snapshot_list parallel.
For admin panel also api.keystone.tenant_list is
parallelized.
Closes-bug: #1660025
Partial-implements: blueprint fetch-resources-in-parallel
Change-Id: Ic789ff98a59ba792d77103e7778883562e7977d2
The response of tenant_quota_usages is now baesd on the limit API,
so tenant_limit_usages and tenant_quota_usages provide same information.
This commit changes all consumers of tenant_limit_usages to use
tenant_quota_usages and updates the corresponding templates.
blueprint make-quotas-great-again
Change-Id: I620e2946f2aca31bac134c247ceaf971498f9eeb
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
Since that file contains translatable text, it may include non-ascii
characters, depending on the language used.
Change-Id: I2051e80b74b42c1817c0992f8a52ffe96b3cabc8
Closes-bug: #1742412
To show volume snapshots from different projects,
we need to specify all_tenants=True to the list operation.
Also fixes an issue that the actions in the snapshots table
in the admin volume detail page refer to the project dashboard.
Change-Id: I8dc50625e0e84fd2ce81d731bd54cbd0e08b100d
Closes-Bug: #1733186
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
During executing tenant_limit_usages quotas function we get
information about cinder volumes/snapshots/gigabites usage
that we've already had after tenant_absolute_limits call.
Getting this information we make more api calls that slow down
our application.
This patch fixes this issue.
Closes-Bug: #1703584
Change-Id: Ia6d2dbb8f18ce93f71668d6ebd2689b851586ca9
Cinder can now show asynchronous error messages that are related to a
volume. However, this requires microversions support.
This patch cleans up the version and endpoint selection logic too. For
compatibility with setups that don't follow good practices, it also
checks for a "volume" endpoint.
Change-Id: Ifdb7537b5208683bb0a81da9ac504d58beaedc89
Closes-Bug: 1352516
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
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
Most of the page_header blocks were removed by previous patches, but
then brought back by regressions in Volumes and Data Processing. This
patch removes those leftover page_header blocks, and removes a few
templates that are not used in Horizon that were found during the
process.
Change-Id: Icbd03f0809a5c664b9b83f06bc398139c3de1184
Closes-Bug: 1436311
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
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
In function VolumeTableMixIn._set_id_if_nameless(), we
define arg `instances`, but we never use it.
Closes-Bug: #1269200
Change-Id: Iac828511bfe8cd417a9c965d063c388fde73052e
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
A lot of horizon's views use the pattern:
def get_data(self):
if not hasattr(self, "_data"):
# Calculate data here.
self._data = data
return self._data
This is copy-pasted all over the codebase. It's better to handle that
with a single decorator. In the future, we might even replace it with
some better caching approach.
Closes-bug: #1248230
Change-Id: Id021fccf9032e5068993ec91a7774a5d0fbf29bb
* Standardized overview pages for volume, image and snapshot
as per the instance overview page.
Fixes bug #1207770
Change-Id: I7ae48542f4c8732c92dc4393dbaaea81158d34d6
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
The referenced template was wrong, and the quota usages information
had not been switched to using limits.
Thanks to Nuno Santos and Rohan Kanade for the initial versions of
this patch.
Change-Id: I97f578b84cd1cd4babab2580c60f0132026e3c93
Closes-Bug: #1194506
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
Fixes all occurrences of this. We have a custom exception handler
in Horizon anyway that only catches ClientException in most of these
cases, but this commit lets us gate on the other cases.
Change-Id: Iea3dc13817f3e5b775b2024424bf3a906da5584b
Closes-Bug: #1211657
This check looks to see whether a local variable
is unused. Also fixed all violators of said check.
Change-Id: I7c186df41b5601078ffc54588aace8136c6576bd
This patch replaces relative imports with full paths and
makes H304 test enabled.
Fixes bug 1188535
Change-Id: I47254cf9a790727102f7993d0fd107da514983df
Existing code was only getting instances scoped to the user's
current token. When calling from the admin volumes view, this
needs to get all instances to correlate volume attachments.
Changed get_volumes to pass all_tenants=True to be consistent,
cinder ignores the value anyway and only looks for the all_tenants
key.
Fixes: bug #1193002
Change-Id: I5ed2a63997126911d6657619b062acd2947d06e1
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537