cinder microversion check (api.cinder.get_microversion) checks
volume endpoint availability in a different order as cinderclient()
does. It does not API_VERSIONS setting in horizon.
As a result, when multiple volume endpoints are configured,
get_microversion() accesses a volume endpoint with a different API
version. At the moment cinder v2 and v3 APIs returns the same info,
so it only affects when cinder v1 endpoint is configured.
This commit introduces a new function _find_cinder_url() to
retrieve a volume endpoint considering API_VERSIONS.
get_auth_params_from_request() is no longer needed and the variable
substitutions are now backed to cinderclient(). It was introduced
so that the memoized decorator worked but the memoized decorator
was improved and we no longer need it.
Change-Id: I69b1fc11caf8a78c49e98aba6c538e5f344b14f2
Closes-Bug: #1864133
api.cinder.get_microversion function now supports OPENSTACK_SSL_NO_VERIFY
and OPENSTACK_SSL_CACERT config options.
This depends on commit 4a3a2c3c9a89ccff4e64d3da96de5b0af4303840 in
python-cinderclient, so the minimum version of python-cinderclient
is bumped to 5.0.0.
NOTE(amotoki): The stretegy of backporting to stable branches needs
a discussion with the requirements team as we cannot bump the
minimum version (at least the major version bump is surprising).
Change-Id: I22c6c60e10d8e9328f7f1e0c24d6c74496ec1a71
Closes-Bug: 1744670
In Train cycle, we moved the definition of default values
to openstack_dashboard/defaults.py. The current code accesses
a dict member using []. It requires operators to define a dict
setting with a full member.
This commit allows to use dict-type settings with partial members.
A new function is introduced to retrieve a dict-type setting
considering default values defined in
{openstack_dashboard,horizon,openstack_auth}/defaults.py
Change-Id: I7ff0ad4bca698aef9c0eba370b0570200a14367a
Closes-Bug: #1843104
Cookie-based settings related to openstack_dashboard are located
under horizon directory,, but they are not related to "horizon".
This commit moves them to "openstack_dashboard" directory.
Part of blueprint ini-based-configuration
Change-Id: Id48ececdbe819a95485e9a91dc5a1a163a5568c3
It seems the behavior of 'partial' argument of Version class __init__
has been changed between semantic-version 2.6.0 and 2.8.1
(though I could not identify the root cause).
'partial' argument is marked as deprecated in semantic-vesion 2.7.0,
so it is a good chance not to depend on 'partial' argument in horizon.
This commit uses Version.coerce() [1] instead to convert non-semver
version into a valid semver version.
We also need to keep the original version information as it is passed
when initializing python-*client (cinderclient and keystoneclient).
In addition, the previous implementation based on semantic-version 2.6.0
returns True for "Version("3.55") == 3". It depends on the behavior
of "partial" argument of semantic_version.Version. It was not
documented and it looks tricky to depend on this behavior.
"major" and "minor" properties are now introduced and api/cinder.py
is updated accordingly. I believe this approach is clearer and stable.
Unit test coverage on dict behavior is improved.
Variable names in the unit tests are adjusted to more meaningful ones.
[1] https://python-semanticversion.readthedocs.io/en/latest/#coercing-an-arbitrary-version-string
Change-Id: If0deee9d0289ff91d58d942b9612f7736356ae18
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
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
Currently horizon defines default values of settings in the logic
using getattr(settings, <setting name>, <default value>) and
it is not easy to handle the default values of available settings.
This commit starts the effort to define default settings explicitly.
This is a preparation for ini-based-configurations.
It covers settings in openstack_dashboard/api.
Part of blueprint ini-based-configuration
Change-Id: Id4c3287f0a572fd14ea93b54bcab8fabda39e583
This patch add 'Project' column in group-snapshot table to the
admin panel.Now user would be able to list all group-snapshot
created by admin or demo user.
Depends-On: https://review.openstack.org/#/c/639314/
Change-Id: I6d77ef7135b15cfa978677c858382a0914d92c5d
This commit allow admin to list/show cinder volume group-spec
using horizon dashboard and user can perform the following
table action :
1. group-spec-create
2. group-spec-edit
3. group-spec-delete
Partially-Implements blueprint cinder-generic-volume-groups
Change-Id: I7a24e21bbf86595bc7e1251d29caed7f7ff5dec8
This patch add 'Project ID' information in instances,Subnet,
Volumes and Volumes Snapshots detail pages.
Change-Id: I48da491d5283ab607d298b454d32a349e97be0d1
Closes-Bug: #1815029
This patch add 'Project' column in volume-group table to the
admin volume group panel.Now user would be able to list that
group is created by admin or demo user.
Change-Id: I5e4837a1a03b50bd6121aa0ab019829fd4a79dbb
openstack_dashboard/api nova.py and cinder.py are imported
by each other. To avoid cyclic imports, some imports are placed
inside functions now, but it would be nice if we can move them
to a separate module and nova.py/cinder.py can import it.
This commit tries to achieve this by moving some stuffs in nova.py
into a separate module named _nova.py.
The module name starts with an underscore to clarify
it is intended to use only in openstack_dashboard.api.
Change-Id: If91cf4f30d2ddab471757129c2a74b26b6d38b1e
This commit allow admin to list/show cinder volume group-type
using horizon dashboard and user can perform the following
table action :
1. group-type-create
2. group-type-delete
3. group-type-update
TODO:
1.group-type-specs support
Partially-Implements blueprint cinder-generic-volume-groups
Change-Id: Iea18913765cda146a0fcae7abe64c999a29cccfe
openstack_dashboard/context_processors.py:94:15: C0122: Comparison should be link['url'] != 'horizon:project:api_access:openrcv2' (misplaced-comparison-constant)
openstack_dashboard/settings.py:467:4: C0412: Imports from package horizon are not grouped (ungrouped-imports)
openstack_dashboard/enabled/_1370_project_vg_snapshots.py:9:0: C0301: Line too long (86/80) (line-too-long)
openstack_dashboard/enabled/_1360_project_volume_groups.py:9:0: C0301: Line too long (85/80) (line-too-long)
openstack_dashboard/usage/base.py:62:8: W0106: Expression "[instance_list.extend(u.server_usages) for u in self.usage_list]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/dashboards/project/images/utils.py:43:12: W0106: Expression "[public_images.append(image) for image in images]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/dashboards/project/images/utils.py:75:12: W0106: Expression "[community_images.append(image) for image in images]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/api/glance.py:47:4: C0412: Imports from package glanceclient are not grouped (ungrouped-imports)
openstack_dashboard/api/cinder.py:60:4: C0412: Imports from package cinderclient are not grouped (ungrouped-imports)
openstack_auth/user.py:358:4: E0211: Method has no argument (no-method-argument)
openstack_auth/user.py:362:4: E0211: Method has no argument (no-method-argument)
openstack_dashboard/api/keystone.py:75:4: C0412: Imports from package keystoneclient are not grouped (ungrouped-imports)
horizon/loaders.py:43:16: W0706: The except handler raises immediately (try-except-raise)
horizon/themes.py:174:8: W0706: The except handler raises immediately (try-except-raise)
Change-Id: I40cf3ffbc4519657e11180d2e2fe7401387c5556
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
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
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
Since @memoized now uses weakref to delete old cache entries, and no
longer keeps the object passed as parameters alive indefinitely, we
no longer need to treat the Request objects specially. In fact, if
we stop doing it, it should improve memory use, because now all
request-specific caches will be removed as soon as the request
object dies.
I also removed the memoized_with_argconv function, and replaced it
with an explicit function for converting teh parameters in the one
place where it was used.
Change-Id: I710b96a170e429c6ffdf22ad3e552ee6e1c6b7e3
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
Since Cinder API v1 is removed in I03bf2db5bd7e2fdfb4f6032758ccaf2b348a82ba
we don't need _replace_v2_parameters function anymore.
Change-Id: I18c2787241f1dcbe4c0afc14a76630d9bfb1162a
Multiattach capable volumes can only be attached with microversion
2.60 or later, so this checks if the volume being attached is
multiattach capable and if microversion 2.60 is available, use it.
Part of blueprint multi-attach-volume
Closes-Bug: #1751564
Change-Id: If708e3edb05cff6e93cfc3dfccb91b1441dcd181
Change cinder api to return None for volume_manage() and for
volume_reset_state(). In this case the tests check these
functions returns correct values.
Partially-Implements: blueprint mock-framework-in-unit-tests
Change-Id: I6694113cb3e8bfa74b1267c6336642d192fbf4ac
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
Previously tenant_quota_usages() uses list API operations
to count usages. It is not efficient. This commit changes
the limit APIs from nova and cinder to retrieve usages.
blueprint make-quotas-great-again
Change-Id: I2c9a479758a1dfe134e5fabf16ab02831338718d
Previously horizon micro-version support only supports one feature,
but there is a case where we need to support more than one feature
using micro-versioning. For example, "instance_description" and
"auto_allocated_network" in the server create operation both require
micro-version. This case was not supported previously.
This commit changes get_microversion() function to take a feature list
and looks up a micro-version which supports all requested features.
A known limitation is that we need to re-call get_microversion() with
different feature(s) if no micro-version which satisfies all requested
features is found and we would like to look up a micro-version which
supports a subset of the requested features. Most features are expected
in recent API versions, so I believe this would be a minor limitation.
Change-Id: I46f1c7fa1ddcf1dfac93d921cffaf3aa5ac011a7
Related-Bug: #1690433
Make cinderclient use volumev3 or volumev2 endpoints, before
falling back to the volume endpoint, otherwise Horizon is
trying to use the v1 API, and that doesn't work with the
"sort" parameter that we are using, resulting in an empty
volumes list.
Change-Id: Id03988d89000c4bc976090c68a41ee320b9d43f7
Closes-bug: #1700977
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
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
Cinder v2 support add or remove volume type access for the given
project since Kilo [1]. This patch add this feature to horizon.
At least cinderclient 1.2.0 is required to support volume type
access extension.
[1]:
https://specs.openstack.org/openstack/cinder-specs/specs/kilo/private-volume-types.html
Implements blueprint: volume-type-access
Change-Id: I323d47ab2aed13305b609e27f8f959f40988537d
The volume backup code is passing '' as a default container name,
which will cause cinder/swift to fail. If no container name is provided,
the default value of None will enable the auto creation of a container correctly.
Change-Id: I7813153c65652ce6e1a5ac03204a8738eefdc64e
Closes-Bug: #1658137
Since Horizon is going to be the first (or, one of the first)
OpenStack component using the new MongoDB driver, it won't be able to
retrieve traces made by other components using MongoDB driver (which
it should use because Ceilometer driver was too slow) for a
while. This means that Horizon itself is responsible for tracing the
rendering of its pages down to the layer where the flow of control
leaves Horizon domain. So, a lot of api wrappers in
openstack_dashboard.api are augmented with tracing decorator to
achieve this goal.
Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Implements-blueprint: openstack-profiler-at-developer-dashboard
Change-Id: Ib36692f0e9e68ed7fa0cd47919ba6581c9c8ab57
Cinder currently expose an api to let the users update the volumes
metadata so horizon should expose this functionality.
The metadata is filtered to remove image metadata attributes. There is
work in progress (in Cinder) that will expose the ability to
write-through image metadata to underlying images where appropriate.
Allowing setting of image properties in this UI would be confusing.
Change-Id: If721ac1c908df7651d630f6e7d36f2cc4d69f5da
Implements: blueprint ability-to-add-metadata-to-cinder-volumes-and-snapshots
Co-Authored-By: Santiago Baldassin <santiago.b.baldassin@intel.com>
Co-Authored-By: Pawel Skowron <pawel.skowron@intel.com>
Co-Authored-By: Bartosz Fic <bartosz.fic@intel.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
Co-Authored-By: David Lyle <david.lyle@intel.com>
Co-Authored-By: Paul Karikh <pkarikh@mirantis.com>
cinder api (api/cinder.py) cinderclient returns an
UnashableKeyWarning for client api_version param.
This patch fixes the bug by removing the api_version param from the
memoized with request function.
Change-Id: I11f3ca8642fb746bd725f059f089f9b3900c6f66
Closes-Bug: #1606020