Commit Graph

54 Commits

Author SHA1 Message Date
Radomir Dopieralski ccef197e03 Don't pass the auth_key for volume transfer in the URL
Instead we pass it as data in the POST request.

Closes-Bug: #2048493

Change-Id: I9085eb146b8f013909f6369b731c076aba3216ab
2024-03-26 10:52:33 +01:00
Akihiro Motoki 7052b7f065 Address RemovedInDjango40Warning (7)
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
2022-02-04 16:27:32 +09:00
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
Akihiro Motoki a9d5273f3c Address RemovedInDjango40Warning (1)
force_text() is deprecated in favor of force_str()
smart_text() is deprecated in favor of smart_str()

https://docs.djangoproject.com/en/4.0/releases/3.0/#django-utils-encoding-force-text-and-smart-text

Change-Id: Ic462fa8c3dfa26e8196df19fef5044036a9e97b4
2022-01-31 22:42:41 +09: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
Akihiro Motoki 692778f8cf pylint: Address no-else-return warning
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.

Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
2020-09-27 12:44:16 +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
Zuul 7830a74fe8 Merge "trivial: Remove 'cache_control' decorator" 2019-09-11 04:46:52 +00:00
Stephen Finucane bb2b1fd6c9 trivial: Remove 'cache_control' decorator
The referenced bug has been fixed in all supported versions.

Change-Id: I0154dd99d83e6873660dc7edb9b40d02ba4e43f1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-09-11 07:29:19 +09:00
Stephen Finucane 1d1c6ce4d2 django22: Replace 'render_to_response' with 'render'
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>
2019-09-11 07:23:46 +09:00
manchandavishal f83324a52c Add Group and Group Snapshot colunm
This patch add "Group" column in Volume table and
"Group Snapshot" column in Volume snapshot table under
admin panel.

Change-Id: Ifa18c70be7d73b302e75ab451b1cd572d970b5c6
2019-03-18 08:22:59 +00:00
Akihiro Motoki 59beb951a3 pylint: Fix consider-using-(dict|set)-comprehension
Change-Id: I81c694c17106c179a53326a12e78cfa899872970
2019-01-13 00:59:05 +09:00
Wangliangyu 9faf1cd109 Fix bug about snapshot pagination
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
2018-11-23 17:12:46 +08:00
Mateusz Kowalski 9810711e75 Make API calls in Volumes view parallel
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
2018-11-15 14:50:01 +02: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 df780f21d7 quota: Merge tenant_limit_usages into tenant_quota_usages
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
2018-05-02 01:19:25 +09:00
Akihiro Motoki 11eb4e9d3e Fix W503 warnings
W503 line break before binary operator

Looking at the code base, it sounds okay to follow this check.

Change-Id: Id511e0104dc6de5b204021661d4a8776ca6d3658
2018-04-11 18:13:47 +09: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
Radomir Dopieralski a65ece737e Handle unicode when downloading transfer credentials
Since that file contains translatable text, it may include non-ascii
characters, depending on the language used.

Change-Id: I2051e80b74b42c1817c0992f8a52ffe96b3cabc8
Closes-bug: #1742412
2018-01-10 21:25:13 +01:00
Akihiro Motoki 17b7e91472 Show volume snapshots in admin volume detail page
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
2017-12-11 17:38:25 +09:00
Daniel Park 8aca02a732 Render 'Volume Transfer' as modal instead of page
Change-Id: Iaa26bacb6ef369145345615821cbe4c3dc24f83f
Closes-bug: #1631193
2017-12-03 06:56:10 +09: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
Mykhailo Dovgal d132c2eb11 Get rid of redundant cinder api calls
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
2017-07-14 16:29:06 +03:00
Radomir Dopieralski 938ee35d94 Show volume's messages in details view
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
2017-06-08 12:51:13 +02:00
Akihiro Motoki baa4ca8dce hacking: noqa cleanup in openstack_dashboard
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
2017-03-17 19:38:47 +00: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
Rob Cresswell 4a71dcfd27 Refactor/remove obsolete page_header blocks
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
2015-03-31 17:23:44 +00:00
Jenkins 7890f9052c Merge "Remove extraneous vim configuration comments" 2014-05-13 21:59:39 +00:00
Zhenguo Niu 235ceff89c Add update method of snapshot name and description
Change-Id: I0c396bee1f14bdb96812012ea89d6fd2bf0c6e34
Closes-Bug: #1265140
Closes-Bug: #1296398
2014-05-07 04:53:06 +00:00
He Yongli e790ac070e Remove extraneous vim configuration comments
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
2014-05-06 15:30:10 +08:00
Zhenguo Niu 3d25f1d595 Move volume snapshots table to volumes panel
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
2014-02-18 10:24:18 +08:00
Zhenguo Niu 3c68470cfc Add volume extend functionality support
Cinder now has the ablity to extend a volume, This functionality
should be exposed through Horizon.

Change-Id: Iff26453fd0a83af97fad4adabbcd53f646a15e51
Implements: blueprint volume-extend
2014-01-17 21:02:06 +08:00
lawrancejing 7f340ce407 Remove unused arg `instances`
In function VolumeTableMixIn._set_id_if_nameless(), we
define arg `instances`, but we never use it.

Closes-Bug: #1269200

Change-Id: Iac828511bfe8cd417a9c965d063c388fde73052e
2014-01-15 08:46:45 +08:00
Zhenguo Niu dcd166e1c8 Add update method of volume name and description
Change-Id: I19596f1b83b061a47a8784962e6f74f1f43048cf
Closes-Bug: #1264411
2014-01-13 14:39:21 +08:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
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
2014-01-07 12:26:35 +01:00
Jenkins e7d50f5fa4 Merge "Allowing snapshoting attached volume" 2014-01-06 13:44:10 +00:00
Zhenguo Niu 04494e8678 Allowing snapshoting attached volume
The cinder api allows calling snapshot on attached volumes,
we should enable it on horizon.

Change-Id: I33d7bbca0bf993ace7c243867aa5f57438a57a5d
Fixes: bug #1202929
2014-01-06 11:15:25 +08:00
Radomir Dopieralski b7537a8b81 Use memoized_method decorator in views
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
2013-12-18 16:46:30 +01:00
Abhijeet Malawade 3686360878 Standardize display name on detail pages
* Standardized overview pages for volume, image and snapshot
as per the instance overview page.

Fixes bug #1207770

Change-Id: I7ae48542f4c8732c92dc4393dbaaea81158d34d6
2013-10-16 02:18:29 -07:00
lawrancejing d33f294ba9 Remove unused LOG
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
2013-09-28 23:57:13 -07:00
Julie Pichon 2ed62bb2e5 Fix volume snapshot creation
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
2013-09-18 18:19:19 +01:00
Tatiana Mazur 953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Kieran Spear 242c8df495 Enable H201: do not write "except:"
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
2013-08-13 17:21:32 +10:00
Alex Gaynor 56ae8fdfc5 Enable pep8 F841 checking.
This check looks to see whether a local variable
is unused. Also fixed all violators of said check.

Change-Id: I7c186df41b5601078ffc54588aace8136c6576bd
2013-07-22 01:09:52 -07:00
Tatiana Mazur 3087c3486b Enable H304 check
This patch replaces relative imports with full paths and
makes H304 test enabled.

Fixes bug 1188535

Change-Id: I47254cf9a790727102f7993d0fd107da514983df
2013-07-16 18:49:56 +04:00
David Lyle 73e62610cf Fixing scoping of instances in admin volume view
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
2013-06-20 16:12:31 -06:00
Matthias Runge cea720e793 Sort imports alphabetically
This patch also re-organizes imports to import one per line.

Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
2013-06-14 12:05:55 +02:00
Eric Peterson d4b0ab4aa3 switching to use limits instead of quotas
Fixes bug 1178694

Change-Id: I6fad061faf84079492338016fd2bada9a2e434f3
2013-06-05 15:40:37 -06:00
Jan Provaznik ea1edcb027 Enable snapshot quota setting
Change-Id: Ie8bcd2d2fddf717a29328bc802a2fda80198183b
Fixes: bug #1177249
2013-05-27 14:22:38 +02:00
Alessio Ababilov decee66cb4 Always return a list from VolumeTableMixIn._get*
Returning None from these methods leads to TypeError
(None is not iterable)

Fixes: bug #1182075
Change-Id: Ia5f5fe78669bbaed599b7dd5cae1beb69bde7796
2013-05-20 16:56:21 +03:00