The boot source must be specified to launch instance. This patch adds
a validation for the allocated sources table length and marks "Source"
tab with asterisk.
Closes-Bug: #1920004
Change-Id: Ifec3bca94845b5d19c37b4c2844f1a983ad9365b
This patch is a follow-up patch addressing the below comments
given on the commit 6ac31e0 :
* delete unused template files.
* Drop "config_drive" option and related code from resize instance
step because it need to show only for Launch Instance.
* grammer correction in the release note
Change-Id: I9ab52927fc6be31d491f010e5e3d9323ddd34e9e
horizon already deprecated launch instance Django based implementation
in the wallaby cycle [1]. This patch remove code for launch instance
Django based implementation as angular based implementation is the
default one from long and all features gaps between angular and Django
implementation is closed.
It also moves SetAdvanced step code to ``resize_instance.py`` as
``workflows/create_instance.py`` file is deleted and remove server_group
option from Advanced Options of resizing instance action because
"server_group" is not required while resizing an instance as per
nova-api reference [2].
Closes-Bug: #1869222
[1] https://review.opendev.org/c/openstack/horizon/+/779125
[2] https://docs.openstack.org/api-ref/compute/?expanded=resize-server-resize-action-detail#resize-server-resize-action
Change-Id: I5e01cd81f309491f1a58ea93911030366a86e3c7
This patch update default value of OPENSTACK_KEYSTONE_DEFAULT_ROLE
to 'member' from '_member_'. If a user tries to create a new project now
it leads to "Could not find default role "_member_" in Keystone" error.
Also long time ago keystone-bootstrap changed the default member role
that is created to member from the legacy _member_ role. Any deployments
that might still be using _member_ should set this explicitly.
Closes-Bug: #1957173
Change-Id: I1fc7f44326b82ceb303f8d663ff0b42f0bdf7855
Default policy in neutron doesn't allow port security to change
if network not owned by the user. To allow users to update other
attributes of a port don't send port_security_enabled attribute
to neutron unless it changes.
If user tries to change port security on a port in a network not
owned by them it will still error as it does now.
Partial-Bug: #1841050
Change-Id: I301336103cabc3f1cab3ee72d7743385ff1a10d6
Get the RBAC shared security groups in the dashboard by making
an additional Neutron API call to filter by the shared field. Currently,
the dashboard only shows SGs owned by the tenant.
Depends-On: https://review.opendev.org/c/openstack/neutron/+/811242
Closes-Bug: #1907843
Change-Id: Ifa1acb3f0f6a33d0b4dc3761674e561a8d24c5c2
In Django 3.2 CookieStorage stores messages in the RFC 6265 compliant
format [1][2]. This means that horizon messages pass through cookies are
encoded in a different way that messages are encrypted.
Previously horizon UT interpretes messages in cookies literally in its own way,
but the change on CookieStorage in Django 3.2 broke it. Horizon should not
depend on its own way. The suggested way I believe is to use a method defined
in django.contrib.messages.storage.cookie.CookieStorage.
[1] https://docs.djangoproject.com/en/3.2/releases/3.2/#miscellaneous
[2] 2d6179c819
Change-Id: I3e5e12265d0bc7b753bbe1f57acdd663b9dd3587
assertFormErrors() now compares actual and expected messages
after parsing them as HTML. Similar to the previous commit,
after Django 3.0 escaped characters are handled differently
(decimal representation, hexdecimal representation and
unescaped representation) so we need an uniform way to compare
texts. Instead of comparing texts literally, this commit changes
assertFormErrors to compare texts after parsing them as HTML.
Change-Id: I4ff89cdcb27a2671c7d79fb2caec30585696a30f
The result of the encoded (i.e., escaped) text in HTML changed
between Django pre-3.0 and 3.0+. For example, decimal and hex encoding
are semantically same but they are different in literal texts.
While I don't know what triggers this change, I think it makes sense
to compare these texts after decoding as HTML.
Considering this, html=True is passed to self.assertContains().
When passing html=True, a text in an HTML element is not compared
partially and a full text as a value of the HTML element is compared,
so we need to pass the full text of an HTML element value now.
I believe the above change is caused by the change that django.test.html.Parser
is initialized with convert_charrefs=False previously. On the other hand,
it is not specified now in Django 3.0+ [1]. This leads to the situation that
escapes on unicode characters are handled differently.
[1] 48235ba807
Change-Id: I0f26436eb384a95f8446d8fd447c9577d50a5c21
It seems Django 3.0+ does not allow to set an unknown attribute
to forms.Form.fields. "keyOrder" attribute has no meaning and
"field_order" of the Form class is the right way to configure
the order of fields.
Change-Id: Ib3a631a3626977a2e7114dac217aacd523354c53
Get groups call is missing after filtering volumes by project name.
This patch fixes it.
Closes-Bug: #1941186
Change-Id: Ib456773aaeff0cb971f735a165cc776f2a80b7b4
At Launch Instance dialog, Source tab, for boot sources Image and
Instance Snapshot there's Format table column. However the title for
it is Type, which is confusing since there is a different property
Type for an image/instance snapshot.
Change-Id: I8f1d3338c58ae4e25bc8437c2a11fd053b2952c1
Admin-Compute-Instances dashboard shows "-" as image name for every
instance. Despite, Project-Compute-Instances dashboard displays image
name correctly. Admin dashboard just lacks code to resolve image name
Also, reverted commit deb55b8 which functionality is not needed anymore
Closes-Bug: #1932341
Change-Id: Ieb19e66dc51165d9935424b2e9ab5cdae757b07f
Currently, "Set Domain Context" and "Clear Domain Context" doesn't do
PRG, so page reload after these actions produce browser popup about form
re-submission. Proposed patch fixes it
Change-Id: I80d11cbdd42224456ee3a354ebad556a318ba03a
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
Proposed patch enables word wrapping for 'Image name' and 'Host' columns
in affected dashboards. Currently, all potentially long names like instance
and image name are wrapped. Ellipsis might be a good idea, but it is not
implemented. Patch [1] just turns off wrapping for instance size (which is
reasonable, it is short in most cases) and hostname (might be very long in
prod environment, because in some cases backend generate some random name
for compute VM)
[1] https://review.opendev.org/c/openstack/horizon/+/5831
Related-Bug: #964738
Change-Id: I3058825c0e4ae114fb397670dbed1c1c6e983552
Most units (KB, MB, GB, TB, PB) are shown in an abbreviated format.
The exception were bytes, which where shown as "Bytes". This commit
resolves this inconsistency by showing "B" for byte units.
Change-Id: Ied94c777a70bf8955f5a328ffcb63d98a7a2befd
Closes-Bug: 1411595
Signed-off-by: Iago Estrela <hiagoestrelas@gmail.com>
The policy_rules feature was added recently, which simplifies making
tabs allowed conditionally based on policy. Use the feature for the User
role assignments and groups tabs.
This is a separate commit to allow the original patch to be backported.
Related-Bug: #1920214
Change-Id: Ic4a16b27c4f2da0daa2ec066d129926c349d1e4b
As a non admin user, navigate to Identity -> Users. Then click on the
username of your user to go to the detail page.
Only the allowed Overview tab is visible.
The view shows three tabs: Overview, Role assignments, Groups. Click on
either Role assignments or Groups. An error will appear, showing that
the API call is unauthorised, and the table content will fail to load.
This change fixes the issue by conditionally loading the tabs based on
policy.
Closes-Bug: #1920214
Change-Id: Ic8b723e6fd423b96a4f5eff54f9392cee534ed9e
This patch replaces the Delete Force Volume Backup/Backups with
Force Delete Volume Backup/Backups as Delete Force Volume Backup
looks incorrect. It also drops the usage of unicode prefix from
``admin/backups/tables.py`` file.
Closes-bug: #1919120
Change-Id: I02f88b6444d268253a3888e2ba56a33bb2f51e73
Also, rename instance_id field to proper port_id.
Before this change, when instance_id was passed from the Instances
page in the URL, the information would be lost on form submission,
and if the form contained an error, the it would be redisplayed with
the port drop-down containing all ports from all instances. This also
made submitting this form slow, as the drop-down would be populated
with all ports on form validation.
It also creates a bug, where if there are more instances than Nova's
pagination allows, the ports from newer instances would no longer
appear in the drop-down, and the form would fail to validate, even
though the choice of port on initial form was correct.
Closes-bug: #1920010
Change-Id: I3ab26c19dc9ea1ed23fcff790d0db919039099eb
we delete the "access_rules" field from the form if keystone API
version is less than 3.13, but we don't consider the case in
clean() method. We are in Wallaby development cycle and we support
N-4 release for upgrade [1]. This means horizon can run with Stein
keystone. Pre-3.13 keystone API (i.e., 3.12) is part of Stein
release [2], so it makes sense to consider this condition.
[1] https://docs.openstack.org/horizon/latest/contributor/policies/supported-software.html
[2] https://docs.openstack.org/api-ref/identity/
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I02e124d90f99d400d8c59bff2c563fdc85e624d4
This bug only appears to be a cosmetic one where the TZ offset
would be calculated on current_year/01/01 so would remain in
daylight saving offset when displaying the timezones list.
(Note by amotoki)
The minimum version of Babel is bumped to 2.6.0
as Babel 2.3.4 returns "New Zealand Time" instead of "New Zealand
(Auckland) Time" returned from the latest Babel (2.9.0).
It is not a good idea to handle such difference in Babel in our UT
and there is no reason to stick to Bump 2.3.4.
2.6.0 was chosen as it is available in Ubuntu Focal and there is
no more reason than this.
Change-Id: I0600086cc51cf5abcf1631565e75146114189667
Closes-bug: #1822849
Add the LAUNCH_INSTANCE_DEFAULTS.default_availability_zone settings in
VM creation dashboard in order to let administrator select a default
availability zone instead of a random one when many are available.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I297ff7f3c8e725c24c7f7687786c784f61f5d4e2
As discussed in the horizon meeting, we think that feature gaps
between the two implementations have been closed. Let's mark
the Django version as deprecated and gather more attentions
from operators.
Change-Id: I55379c0897bad46decfabb443afe9439a31a3164
This commit allows admin to list/show cinder volume backups
using horizon dashboard and the user can perform the
following table action :
1. backup-restore
2. backup-delete
3. update backup-state
4. backup force-delete
Implements https://blueprints.launchpad.net/horizon/+spec/add-volume-backups-support-for-admin-panel
Change-Id: I2fea140a972eb4bd4f18ad1c83cfa4df58c23f6c
There is a case where volume_image_metadata attribute does not exist.
It looks like it happens for example when a volume was created before
the volume_image_metadata feature was implemented.
Change-Id: I0b8e6b2e540a1782b9edd9921490a9371d31afc7
Closes-Bug: #1916891
During reviewing https://review.opendev.org/c/openstack/horizon/+/772603,
we noticed that a method decorated by create_mocks is called multiple time
in a single test. Previously create_mocks decorator does not stop mocking,
so this means that multiple active mock can exist for one method.
In general, it is not a good idea to mock a method multiple times at the
same time.
To cope with this situation, this commit ensures for create_mocks decorator
to stop active mocks when exiting the decorator.
This works for most cases, but it does not work only when mocking and
assertions are handled by separate methods and test logic is placed between
them. To cope with this, "stop_mock" optional argument is introduced.
FYI: Details on why "stop_mock" is needed.
I explored various ways but could not find a good way so far.
create_mocks needs to be a decorator as it needs to refer an object
reference (self). On the other hand, if we would like to merge the logic of
mocking and assertions (for example, _stub_api_calls() and _check_api_calls()
in openstack_dashboard/dashboards/project/overview/tests.py), a context
manager would be good as we would like to call it inside a class.
However, we cannot mix a decorator and a context manger as a decorator is
executed when a context manager is iniitialized and stopping mock in
the create_mocks decorator is done during the initialization of the
context manager and methods are not mocked when test code is run.
Change-Id: I9e37dc1eaa08adf36d11975fed6f5a0a90cdde52
Community images which are not owned by a focused project are not
included in the normal image list API (i.e., without specifying
"community" as visibility), so we need an extra call of the image
list API specifying "community" visibility in a filter.
It was originally fixed by [1] but was dropped in [2].
The main motivation of [2] is to address "Duplicates in a repeater
are not allowed" error in the JavaScript console.
The approach of [2] was to drop multiple glance API calls, but
the right solution would be to check duplicated images included
in both API calls. This situation with duplicated images happens
when a community image is owned by a focused project. In such case,
the community image is included in the responses of both API calls.
This commit adds a logic to check image IDs already processed.
[1] https://review.opendev.org/c/openstack/horizon/+/614688
[2] https://review.opendev.org/c/openstack/horizon/+/640762
Closes-Bug: #1914045
Related-Bug: #1779250
Related-Bug: #1818508
Change-Id: I2ed1b6064ddd6f62818d6112e98e5d5a98beae9d