The previous code does not handle a case where admin-specific attributes
do not exist. This leads to AttributeError in the project instance detail
page as these attributes are not included in the response from nova API.
Change-Id: I4c2942960259782d47c6777394dec6888959e26c
Closes-Bug: #1905024
unescape_port_kwargs() in api/neutron.py changes a key of dict
during the iteration and it is not allowed in python3.
Change-Id: Ifc1b9a0191aacd32e8c8ecc082b6313f04003f63
Closes-Bug: #1900851
Part of the removal of OPENSTACK_NOVA_EXTENSIONS_BLACKLIST (3/3)
Clean up nova extensions related code in the API layer.
Change-Id: I9730095365342cac1023f4112bae4b3a28cdeaf7
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
Patch I0cfe9090e8263f983fa5f42f42616a26407be47a adds hypervisor hostname
to the instance details view. This patch adds the rest of instance
attributes allowed by 'os_compute_api:os-extended-server-attributes'
policy.
Change-Id: Id39ee14e3054422a96248f8cdd0a5bf07c27f2fc
Closes-Bug: #1874273
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 default url should be of type "OPENSTACK_ENDPOINT_TYPE"
parameter as specified in settings.
Closes-Bug: #1873353
Change-Id: I05ce933e5bd01bf59a52e7d49facce26efa693aa
The backups pagination was with a bug that prevents users from
access older backups when the number of backups exceeds the
page size configurated in 'API_RESULT_PAGE_SIZE' properties.
The bug was occurring because the pages displays (Next, Prev) were
not displayed in the backups page, leaving the user with only
the first page to access their backups, so the backups from other
pages are unreachable.
Was fixed this bug and also was added new buttons to access
a specific, the last and the first pages. Easing the users'
navigation through the backups pages.
Change-Id: I148634152484f9718759775b81aab3703a296ef5
Fix tempest jobs to properly use tempest-horizon as tempest-plugin in
job configuration.
Flake8 3.8.0 fixed a few bugs so that additional issues are marked, fix
these.
Co-Authored-By: Andreas Jaeger <aj@suse.com>
Change-Id: I2aca3286ea2cc1ade567087786781952489d6efa
Kyestone V2 support was removed in Train, so it's safe to do such cleanup.
* Functions which just return horizon settings are dropped and
the settings are referred directly now.
* The service catalog in the sample test data is updated to match
the format of the keystone API v3.
* Related to the above change of the sample service catalog,
openstack_dashboard.test.unit.api.test_keystone.ServiceAPITests is
updated to specify the region name explicitly because 'RegionTwo'
endpoint is no longer the second entry of the endpoint list in the
keystone API v3.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ib60f360c96341fa5c618595f4a9bfdfe7ec5ae83
+ Adds endpoint for listing available policies
+ Support to select a storage policy for new containers
+ Display container storage polcy on dashboard.
Change-Id: I588452fd5d6417859f5dd19ccedcb18f420ab646
When the image upload finishes, we try to delete the temporary
file that was used for the upload. However, depending on how
Horizon is deployed, instead of a file it can be a BytesIO
instance, which leads to an AttributeError. This happens in
a separate thread, so Horizon itself doesn't crash, but it's
better to catch that exception.
Change-Id: Iaa66d9c87060c1e001f3f6e31f630d6092df55d3
Closes-Bug: #1866632
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
We have several codes to handle the differences between py2 and py3.
py2 support has been dropped so there is no need for them now.
Change-Id: I30080f4e1a5ac04860c4341d966ee53131eb2022
We don't support Python 2 anymore so we don't need this
compatibility library.
six.reraise usages are left as is until it'll be moved to some
base lib like oslo.utils to not re-implenent this method in
Horizon.
This patch also removes Python2-specific base test case methods
assertItemsEqual and assertNotRegexpMatches in flavor of new
Python 3 analogues.
Change-Id: I26a59176be9e9f213128e4945a58b9459334b626
This patch resolves an issue with the "prev" link when instances
have identical "created_at" values. This can occur when creating
instance using the "min/max count" option. The reverse sort does not
work correctly as the server list returned from nova is not an exact
reverse as the forward sort. It looks like the combination of sort_keys
must be unique to ensure the forward and reverse pagination properly.
As a workaround 'uuid' (server ID) is added to 'sort_keys'.
In addition, 'display_name' is added before 'uuid' in 'sort_keys'
to list servers in the alphabetical order (which sounds natural).
Closes-Bug #1856243
Change-Id: I73234b2c69ce8ea648b4a9721abe4f5670031909
This patch allows administrators to set disk_formats only for glance,
while horizon will retrieve list of supported formats from glance API.
IMAGE_BACKEND_SETTINGS still may be used to redefine display name
of the format or additionally limit list of availble ones.
Change-Id: Ia4ea513023895f4ad2a87f91e3d2837c7668d9ae
Closes-Bug: 1853822
In case of Keystone Multidomain setup, the project and users list
is empty when the domain context is changed. Horizon uses domain
scoped token for keystone api calls to get list of projects and users.
And domain scoped token cannot get information about projects and users
in other domains, the list is empty.
This patch modifies the use of domain scoped token only when domain
context is not modified.
The bug have 3 parts
1. Users are not listed on GUI in different domain
2. Projects are not listed on GUI in different domain
3. Gui hangs during creation of user/project using + option
This patch handles case 1 and 2.
Change-Id: Ibafe3e2eb3ee1ee5c9eb5d2a276a0edfa3e7c607
Partial-Bug: #1826114
Closes-Bug: #1830782
Horizon's AngularJS pages (for example Images and Keypairs)
display dates using browser's timezone now. This change makes
AngularJS pages use Horizon's Settings Timezone instead of
browser's timezone and if Timezone is not set under Settings,
AngularJS pages will display dates in 'UTC' timezone.
Closes-Bug: 1832768
Change-Id: Ibbed19600bfe6b13c43b9f09fa484cb78524b0d6
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
The novaclient list_extensions API binding was removed in the
16.0.0 release [1]. The ability to enable/disable extensions
in nova has been deprecated since Liberty [2] and was removed
in Newton [3].
For horizon this only matters for the OPENSTACK_NOVA_EXTENSIONS_BLACKLIST
config setting and some javascript code used to compile panels based on
enabled extensions. In order to work with novaclient 16.0.0+, this
change removes the list_extensions usage since all extensions
are enabled in nova and thus for horizon a nova extension is only
not supported if it's in the configured blacklist. To continue supporting
the javascript code which uses the getExtensions function, the extension
names are hard-coded. Note that the method meant to test that code,
_test_extension_list, was wrong but never ran because of the underscore
prefix on the method name. That is fixed here.
[1] https://review.opendev.org/686516/
[2] https://review.opendev.org/214592/
[3] https://review.opendev.org/351362/
Change-Id: Iebb1e78c718b931d632445e4de6d7a29ccb92be2
Closes-Bug: #1847959
Glance V1 API was deprecated in Stein release in Horizon and
deprecated in Glance since Newton release.
Change-Id: I18f6fd03dd3e07fa4f2ccfdccfdc3ca766c91c16
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
When editing an image, if the disk_fomrat is 'vhd',
the container_format was wrongly set to 'bare' before.
'ovf' is the correct container_format for 'vhd' disk images.
Closes-Bug: #1539722
Change-Id: Ic6b0c66af0d5c8db2d802d6eea2b97721d92b7eb
Keystone V2 API was deprecated in Stein release in Horizon and
removed from Keystone in Queens release.
Change-Id: I917e273d3174adf0874e516b3d635ccb8ba58a27
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
Resolves the following warning:
DeprecationWarning: Using or importing the ABCs from 'collections'
instead of from 'collections.abc' is deprecated, and in 3.8 it will
stop working
Change-Id: Ib2214e7560cda1ef510c08859d5ee0726eb66b7b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
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
In the early days of OpenStack, user and project ids were not
uuids, but auto-incremented integers.
Since those early days, many operators fought long battles
against the unrelenting OpenStack behemoth.
Only those heroic operators who emerged victorious from the
brutal upgrade battles can show the scars of those integer
user and project ids like badges of honour.
Closes-Bug: #1842004
Change-Id: I0c3e3465e8e7499c94d1a82b7295aeec13955e55
When listing security groups in the dashboard and
one or more security groups had no rules it failed
because python throws a KeyError.
This commit changes the neutron API wrapper in horizon
to ensure ensure rule information in SG always exists.
Closes-Bug: #1840465
Co-Authored-By: Tobias Urdin <tobias.urdin@binero.se>
Change-Id: I6e05a7dc6b6655514ee2bff6bd327da86f13900a