Commit Graph

14 Commits

Author SHA1 Message Date
Brian Rosmaita b58ac2894b Drop cinder v2 API support
Cinder v2 API is deprecated since pike release. Along with the removal
of cinder v2 API support in cinderclient (change I335db5c1799e drops
v2 support), this commit drops cinder v2 support in horizon.

The next release of python-cinderclient drops v2 support,
so horizon needs to use v3 classes.

Includes a workaround in unit tests for two cinderclient.v3 classes
that are missing in the cinderclient releases prior to 8.0.0.  The
workaround can be removed once cinderclient change I335db5c1799edb2
is merged and released.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Iab0f097fab6696462572dc6ea53767c91e5411b1
2021-07-19 08:00:58 -04: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
Ivan Kolodyazhny 14e779bbac Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I2de669d8e89b8daeb7ee5405ffab35af6307c40b
2020-03-26 19:45:37 +02:00
Akihiro Motoki 431fd6c16b Drop cinder consistency group support
Cinder consistency group has been replaced by the generic group feature.
Horizon support of the generic group (in the project dashboard) is
available since Rocky release and it covers all existing support
for consistency group in horizon.

The consistency group support is horizon was marked as deprecated
in Stein release [1].

This commit drops the consistency group support.

[1] https://review.openstack.org/#/c/626846/

Change-Id: I11187d2b03b7e0033a6c6ba3f8be25b8b5e4dd74
2019-05-03 18:16:23 +00:00
Akihiro Motoki 000da0f8fc api.cinder: refactor microversioning logic
There are sevral similar logics to handle microversioning
in Cinder API wrapper. This commit refactors them and
introduces _cinderclient_with_features() function.

The parent commit to fix bug 1810309 does not introduce
this logic to make it easy to backport the fix.

Change-Id: I378e58c7a80e2d00481a582eb3fa449f51c3612a
Related-Bug: #1810309
2019-01-15 08:32:34 +09:00
Akihiro Motoki 32bfbbf100 Use correct cinder API version for tenant_absolute_limits
To verify resource usages when updating project quotas,
project_id query parameter needs to be supported in
tenant_absolute_limits in the cinder API.

This is supported in 3.39 or later in the cinder API.
API vesions shipped with released versions (pike, queens and
rocky) are selected as verified versions.

Change-Id: If5fc190988cf173387da2b66be23db9134310692
Closes-Bug: #1810309
2019-01-15 08:32:34 +09:00
manchandavishal c02b9fc2dd Get rid of keys() usage
for x in some_dict.keys() can be written as for x in some_dict

Change-Id: If5436647a30c02d0dab7daa23b2290456c66d654
2018-11-30 11:15:27 +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 32d463a298 Generic volume group support
This commit adds cinder generic group support.
Consistency group support are not shown if the generic group
support is available.

blueprint cinder-generic-volume-groups
Change-Id: I038eeaf2508926f18b6053db0082a8aa3f3e20c6
2018-06-09 06:39:18 +00:00
Ivan Kolodyazhny 8ce6b37e5c Remove Cinder API v1 compatibility
Since Cinder API v1 is removed in I03bf2db5bd7e2fdfb4f6032758ccaf2b348a82ba
we don't need _replace_v2_parameters function anymore.

Change-Id: I18c2787241f1dcbe4c0afc14a76630d9bfb1162a
2018-06-05 18:11:42 +03:00
Akihiro Motoki 7b7ace0aeb Simplify APIMockTestCase
There is no need to use stub_*client() because we can simply use
mock.patch(.object). This commit removed stub_*client().

Part of blueprint mock-framework-in-unit-tests
Change-Id: I1563720e3fc636f7b042d030baf59e0b1a0e9bf0
Signed-off-by: Akihiro Motoki <amotoki@gmail.com>
2018-04-08 07:58:50 +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
Akihiro Motoki f3af02f20f openstack_dashboard: Move test files to match module structure
This commit relocates test codes in openstack_dashboard
according to blueprint relocation-test-codes.

Change-Id: I397a5a47fe9c1bf3a498c22056d924bf409c514b
2017-12-09 21:38:06 +09:00