Commit Graph

1611 Commits

Author SHA1 Message Date
Zuul e7d8005321 Merge "Add a setting for disabling dhcp agents column in the admin network view" 2024-03-08 17:44:21 +00:00
Zuul 061380cba7 Merge "fix: ignore errors when flavors are deleted" 2024-03-04 07:20:21 +00:00
Radomir Dopieralski 1ea4f4d76f Add a setting for disabling dhcp agents column in the admin network view
Retrieving that information for every network can take considerable time
on large deployments with large number of networks, and for some kinds
of network drivers (ovn binary) this will be always zero anyways.

This setting lets us disable that column to speed up the networks view.

Change-Id: I1f1561916067d3f4a02f10ec9f62e8ba777a1501
2024-02-22 17:36:12 +01:00
Zuul 1966d5ce82 Merge "Remove quota checks from admin network dashboards" 2024-02-06 09:13:12 +00:00
Tatiana Ovchinnikova 3acbf227a4 Add allocation ratios to Placement stats
All the Placement API stats "total" show the actual amount of the
resource that the provider can accommodate. Using allocation ratio
it is possible to exceed physical constraints.

This patch uses allocation ratios to display the diagrams properly
and adds the data to the stats table.

Closes-Bug: #1974470
Closes-Bug: #1397917

Change-Id: Iab0ce21ae63f4cc26d3ec5684615189b8ab35231
2024-01-17 21:00:32 +00:00
Radomir Dopieralski ce950e4eb4 Remove quota checks from admin network dashboards
Remove the checks for quota for network, subnetwork, and port create
actions in the admin dashboards. While the checks are a nice feature
in the project daashboard, where they result in only one call, because
only one tenant needs to be checked, on the admin dashboard those
checks are too expensive — there is one for every tenant that has a
network. This is unacceptable on clouds that have hundreds of tenants,
and in addition it exhausts the default limit for memoization (25),
resulting in many other extra calls.

The effect of this is that the create action will no longer be grayed
out when the given user runs out of quota. This doesn't matter for the
admin user. If they try to perform the action, they will get a quota
error anyways.

This patch should significantly speed up the admin dashboards on large
clouds with a lot of tenants.

Change-Id: I67447bad868f29022c5247c2193ec804dc2a0518
2024-01-04 11:51:25 +00:00
Radomir Dopieralski ebdb19ab8c Use Placement API along with the hypervisor stats
Hypervisor stats do not reflect accurate VCPUs and PCPUs usage, so
to have a correct picture we need to use Placement API along with
hypervisors.

We add VCPUs and PCPUs usage diagrams and Resource Provider tab
to display correct stats.

Since there is no python client for the Placement API, and the
OpenStack SDK doesn't support the endpoints we need, we call the
endpoints directly.

Related-Bug: #1974470
Related-Bug: #1397917

Change-Id: If41cea0edeec8c95717229eb017e32898417a891
2023-12-06 15:39:34 +00:00
okozachenko aa21f4baa3 fix: ignore errors when flavors are deleted
The code used to list flavors when in the admin
or project side was not consistent and raised
alerts if viewing in the admin side but not in the
project side.

This patch moves their behaviour to be consistent
and refactors the code to use the same code-base.

Closes-Bug: #2042362
Change-Id: I37cc02102285b1e83ec1343b710a57fb5ac4ba15
2023-11-02 01:27:40 +11:00
Thomas Goirand 8770753fcc Specify transform=repr in assertQuerysetEqual()
Previously "repr" was automatically applied to "qs" argument of
assertQuerysetEqual() and most horizon unittest behaviors assume it.
It was deprecated in Django 3.2 and removed in Django 4.1. We need to
specify transform=repr explicitly to use the existing behavior.

[1] https://docs.djangoproject.com/en/3.2/topics/testing/tools/#django.test.TransactionTestCase.assertQuerysetEqual

Closes-Bug: #2038474
Change-Id: Ie7c7e9a1efc492889639e25509c8e614268c1d26
2023-10-23 14:24:49 +09:00
Zuul 5fa4941310 Merge "Add the filter function in c-bak dashboard for both Project & Admin" 2022-12-14 17:35:23 +00:00
Tatiana Ovchinnikova af7e6c4f75 Fix flavor id auto generation
Currently the flavor creation form always check for the uniqueness
of the UUID field, even when it is set to "auto". That means that if
we create a flavor with UUID value of "auto", the check will fail.

This patch disable the check when UUID is automatically generated.

Change-Id: Ie31307d67cf3857e3bb80c124e92c81e0c6a2982
2022-11-02 14:13:36 -05:00
Zuul 443134b54a Merge "Don't try and update port security if its not changing" 2022-09-20 17:43:01 +00:00
Jesper Schmitz Mouridsen 20a571fdd2 Add cinder-user-facing messages for Backup
This patch adds a tab for cinder user messages for volume backups.
Cinder user messages show error details for cinder resources like if we
are unable to create a volume backup due to some failure in cinder it
will show us the reason for failure.
It also updates project and admin SnapshotDetailsTabs to use
DetailTabsGroup instead of TabGroup to improve top padding.
Also adds the fail_reason in the detail view, if backup errored.

Related-Bug https://bugs.launchpad.net/cinder/+bug/1978729

Change-Id: I4e639211043270e814fac489f915588af03f966a
2022-09-06 07:29:40 +00:00
okozachenko 3020cf5e5c Add the filter function in c-bak dashboard for both Project & Admin
Change-Id: I09b0d12e489aad8da8e9ed3dee1b02a5abcb7355
2022-08-31 02:03:07 +10:00
Zuul 0798bdacd3 Merge "Add SYSTEM_SCOPE_SERVICES setting that hides panels" 2022-03-24 10:36:17 +00:00
Radomir Dopieralski 6c814b241d Add SYSTEM_SCOPE_SERVICES setting that hides panels
Since not all services are ready to use the system scope token,
we need a way to disable and enable the use of system scope
token on a per-service basis. This setting let us configure
which services should use the system scope token. By default
the list is empty and system scope token is not used at all.

Change-Id: I5e0cdc7288221571f183a37b800c19dc4cff5707
2022-03-10 15:13:21 +01:00
Zuul 52a1025047 Merge "Address RemovedInDjango40Warning (4)" 2022-03-10 12:24:44 +00:00
Zuul cf9a30d39e Merge "Address RemovedInDjango40Warning (3)" 2022-03-10 12:23:11 +00:00
Zuul dd9e4c82b5 Merge "Address RemovedInDjango40Warning (2)" 2022-03-03 10:14:04 +00:00
Rodrigo Barbieri 196de449b6 Implement pagination in admin/proj network tab
Added pagination support to the networks page under
Project and Admin Dashboard.

To accomplish so, the method network_list_for_tenant
in api/neutron.py that is used for listing networks under
the Project Dashboard was refactored to merge the different
requests for shared, non-shared and external networks while
tracking the pagination for each of those requests, so for
instance when all the shared networks are listed and paginated
then the non-shared networks are queried and so on.

For the Admin dashboard all network types are retrieved under
a single request so it is a simpler pagination logic.

Partial-Bug: #1746184
Change-Id: I96a2d6cabed47c89bdc02ec922d7f9451e5ec025
2022-02-16 18:15:48 -03:00
Akihiro Motoki e4444e6979 Address RemovedInDjango40Warning (4)
In Django 3.0, django.utils.http.urlquote(), urlquote_plus(),
urlunquote(), and urlunquote_plus() are deprecated in favor of
the functions that they’re aliases for: urllib.parse.quote(),
quote_plus(), unquote(), and unquote_plus().

https: //docs.djangoproject.com/en/4.0/releases/3.0/
Change-Id: I37fcd917cbf87b4d3141cfbdd2675aa38f33f2a4
2022-02-04 16:27:18 +09:00
Akihiro Motoki d9266fd82c Address RemovedInDjango40Warning (3)
In Django 3.1, django.conf.urls.url() is deprecated
in favor of django.urls.re_path().

https://docs.djangoproject.com/en/4.0/releases/3.1/#id2

Change-Id: I484694f8718f61c022126a1935cf28fce075894b
2022-02-04 16:26:54 +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
Zuul 8e7d0933a6 Merge "Retrieve volume groups after filtering by project" 2021-12-09 00:16:25 +00:00
Sam Morrison d059b0bc40 Don't try and update port security if its not changing
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
2021-11-24 08:37:08 +11:00
Akihiro Motoki 44b7c03fba Support Django 3.0 and 3.1 support (4)
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
2021-09-14 19:36:27 +00:00
Tatiana Ovchinnikova 93b18ce573 Retrieve volume groups after filtering by project
Get groups call is missing after filtering volumes by project name.
This patch fixes it.

Closes-Bug: #1941186

Change-Id: Ib456773aaeff0cb971f735a165cc776f2a80b7b4
2021-09-10 15:49:49 -05:00
Vadym Markov 4a2a1db145 Show image names at Admin-Instances dashboard
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
2021-08-11 18:12:09 +03:00
Zuul 153f50ca05 Merge "Make word wrapping consistent" 2021-07-29 14:52:49 +00:00
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
Vadym Markov b6439399e0 Make word wrapping consistent
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
2021-06-25 15:03:40 +03:00
Pedro Kostelec ae7896cea5 Consisent abbreviation of size units
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>
2021-05-04 11:50:17 -03:00
manchandavishal 893d0c026e Replace Delete Force Volume Backup with Force Delete Volume Backup
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
2021-03-18 12:13:18 +00:00
manchandavishal 1d39ac761f Add Volume backups support for admin panel
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
2021-03-05 00:15:08 +00:00
YuehuiLei 87f498bee5 Drop the usage of unicode prefix from unicode strings
All strings are considered as unicode strings in python 3,
so we no longer need "u" prefix (u'...').

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I796d2fcdca066475bbf29d25cbf2aa67b2b2178b
2021-02-12 13:05:27 -06:00
Tatiana Ovchinnikova 76f196d1ed Add option to set MTU on network creation
Setting MTU is now available for network creation on project and
admin panels.

Closes-Bug: #1549636

Change-Id: I384a6b78eaf75d9c0373cdfa51c3ea5f53f63e6b
2021-01-19 12:32:15 -06:00
Zuul d27160096b Merge "Drop the usage of nova extensions in python code" 2020-11-18 13:33:09 +00:00
Zuul ff1af2f1a4 Merge "Non-api filters not working with admin instance tab" 2020-11-18 13:33:06 +00:00
vinay_m 6b79cdcc1b Non-api filters not working with admin instance tab
The issue was that the filtering opts like project_name, image_name,
flavor_name that are not supported by nova API (non-api filters) do
not work expectedly. These filters are mapped to their IDs [1], but
an instance list retrieved before resolving non-API filters is used [2].
This commit changes the logic to resolve non-API filters first and
then retrieve instances using the updated search_opts.

Note that the image list is handled a bit specially. If 'image_name'
is specified as a filter, we retrieve a corresponding image detail
first before fetching instances to resolve the image name into its ID.
Otherwise, we retrieve images only related to instances retrieved
and this happens after retrieving instances.

[1] f90c3cd501/openstack_dashboard/dashboards/admin/instances/views.py (L166)
[2] f90c3cd501/openstack_dashboard/dashboards/admin/instances/views.py (L154)

Closes-Bug: #1888490
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Id43adbd44778d3375c0d49da3f7530cbb99e16fe
2020-10-27 20:07:57 +09:00
Akihiro Motoki c45cc6b1c5 Drop the usage of nova extensions in python code
Part of the removal of OPENSTACK_NOVA_EXTENSIONS_BLACKLIST (1/3)

All references of nova extensions in the python code are cleaned up.
Note that the API layer is not touched yet as it is used by the
JavaScript side.

Change-Id: I66cd0a9629253a6462aace9902ef8200b94b2a21
2020-10-27 20:00:45 +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 74df97f57c pylint: Fix unnecessary-comprehension warning
'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
2020-09-27 12:44:16 +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
Zuul 79e505520f Merge "Add cinder-user-facing messages" 2020-09-10 18:04:09 +00: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
manchandavishal be461acd6f Cleanup for Refactor-error-messages
This patch is a clean-up patch for refactor-error-messages bp
which remove the exception message from base message otherwise
the same exception message display twice like
this https://ibb.co/XyFWMdz .

Partially-Implements blueprint refactor-error-messages

Change-Id: I46b632dbb6701785e7d654feff336a27d6ecea9c
2020-09-04 10:39:11 +00:00
Zuul 516ea144cd Merge "Fix tenant_id for a new port." 2020-04-27 11:59:57 +00:00
shenjiatong 3c33f46dc8 Fix tenant_id for a new port.
To successfully create a port in a shared network which belongs
to a different tenant, the tenant of the new port should be same
as the tenant of a request user.

Closes-bug: #1815461
Change-Id: Ia243f213b23f3f34845de5d97e8eaa5aa6979e76
2020-04-17 10:54:25 +09: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
Stephen Finucane 2b3ab46440 Remove errant references to mox
There is still a single user of mox but all other references to this can
be removed. Do just that.

Change-Id: I611573a41c47e99e41a54bf53cea55322a493de1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-01-30 10:35:50 +00:00