5685 Commits

Author SHA1 Message Date
Takashi Kajinami
85316931bd Replace pytz by built-in library
Python >= 3.9 provides the zoneinfo module to manipulate timezones.
Replace pytz by the built-in library to reduce external dependency.

Change-Id: I22707f966b692c056cedecaa83bf2cb0a29c09aa
2024-06-12 14:21:34 +09:00
AgnesNM
13722c202b Fix the display of 'None' in the Volumes table
The 'Attached To' column in the Volumes table was inconsistent with
    the rest of the columns in that it did not display anything when a
    particular volume was not attached to any instances.

    This change results in displaying the status of 'None' on the
    'Attached To' column as a dash[-].

    The status is 'None' when a particular volume is not attached to any
    instance.

    Closes-Bug: #1743226

Change-Id: Ife6221351c02b222b326b06cb45c685bd3cffbdf
2024-06-05 15:08:59 +03:00
Zuul
058815d1f5 Merge "Sanitize data for CSV generation" 2024-05-01 16:15:17 +00:00
Tobias Urdin
0ffd5c7ae1 Show Created At column for backups table
The backups tables does not show the created_at
field today and to find the one you need by
date you need to open all backup to figure out
what date you want, this is not optimal since
the whole point of backups is to jump back to
a date as quick as possible.

Change-Id: Ie68e54d41b0ad919ecc468e162b4939eac3ae4b3
2024-04-26 21:03:38 +02:00
Tobias Urdin
dbdd376462 Show availability zone for volume backups
This adds availability zone fields to volume
backup tables.

Change-Id: I6bf7c3ef4f6d6b73a6fafcc9b7038ccc4782037f
2024-04-24 10:33:25 +02:00
Zuul
793b8af149 Merge "Fix Users/Groups tab list when a domain context is set" 2024-04-19 04:08:45 +00:00
flokots
55e9db6528 Add help text for edit instance form
This commit adds help text to the Edit Instance form to describe the
limitations of the text allowed in the name and description. The help text guides the maximum length for the instance name and description
and advises against using special characters or leading or trailing spaces. By providing this information, users will be better informed when modifying instance details, reducing the likelihood of
encountering errors.

Closes-Bug: #1981165
Change-Id: If8879c20b2842c3dd769e4cdef80834219c637cd
2024-04-02 22:30:25 +00:00
Radomir Dopieralski
ccef197e03 Don't pass the auth_key for volume transfer in the URL
Instead we pass it as data in the POST request.

Closes-Bug: #2048493

Change-Id: I9085eb146b8f013909f6369b731c076aba3216ab
2024-03-26 10:52:33 +01:00
Tatiana Ovchinnikova
c6bba842af Sanitize data for CSV generation
CSV generation is not fully sanitized to prevent CSV injection.
According to https://owasp.org/www-community/attacks/CSV_Injection,
we have to use the following sanitization:
 - Wrap each cell field in double quotes
 - Prepend each cell field with a single quote
 - Escape every double quote using an additional double quote

The patch https://review.opendev.org/c/openstack/horizon/+/679161
takes care of the double quotes. This patch adds a single quote to
the cell fields beginning with specific characters, so their content
will be read by a spreadsheet editor as text, not a formula.

Closes-Bug: #2048106

Change-Id: I882fe376613ff1dc13a61f38b59d2a2567dbba7d
2024-03-25 12:08:00 -05:00
Zhang Hua
ed768ab507 Fix Users/Groups tab list when a domain context is set
The list of users assigned to a project becomes invisible when a domain context
is set in Horizon. If a domain context is set, the user list call should
provide a list of users within the specified domain context, rather than users
within the user's own domain.

Groups tab of project also has the same problem.

Change-Id: Ia778317acc41fe589765e6cd04c7fe8cad2360ab
Closes-Bug: #2054799
2024-03-12 12:02:45 +08:00
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
Rodrigo Barbieri
3c0557d698 [TRIVIAL] Add comment about policy override for images>launch button
For some reason the policy rule name changes as it is processed and
becomes non-obvious what to set in the override file to alter the
policy for the images>launch button.

Change-Id: I1e843784a53801da98a9d384be0190fbb5bdfee2
2024-02-27 10:50:13 -03: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
ba9a318359 Merge "Fixing Incorrect URL when browsing Swift containers" 2024-02-19 14:36:16 +00:00
Zuul
590632cf5c Merge "Extend configurable skippability of neutron calls to project instance detail" 2024-02-13 14:46:03 +00:00
Zuul
1966d5ce82 Merge "Remove quota checks from admin network dashboards" 2024-02-06 09:13:12 +00:00
Rodrigo Barbieri
95089025fd Extend configurable skippability of neutron calls to project instance detail
The OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES config aids
in envs struggling to load the instance list due to having
too many ports or bad neutron plugin performance. However,
the config does not apply its effect to the instance detail
page, which cannot be loaded due to the neutron calls
taking too long.

This patch extends the config option to the instance
detail page, allowing the same benefit (and side-effects)
of the instance list page.

Related-bug: #2045168
Change-Id: I3e71a208a1c7212e168d63a259f2adddf27dbabf
2024-01-29 15:11:33 +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
jeremy-boyle
4aa347fe19 Fixing Incorrect URL when browsing Swift containers
This patch fixes a bug identified in the code that generates the URL for
the Swift container object. The bug caused the forward slashes (/) in the
folder parameter to be encoded as %2F instead of being included as '/' in the
resulting URL.

To resolve this issue, the code has been updated by adding a replace() method
to replace the %2F sequences with forward slashes. The updated code ensures
that the URL generated for the folder parameter contains the correct forward
slash (/) representation.

Closes-Bug: #2009724
Signed-off-by: jeremy-boyle <jeremyboylet@gmail.com>

Change-Id: I5837e74ddcc71cda6b4686e586dbb8b1386a9cd3
2024-01-05 10:09:13 +00:00
Zuul
108c8c2043 Merge "Use Placement API along with the hypervisor stats" 2024-01-04 13:45:55 +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
Tobias Urdin
53c82bbff7 Fix floating IP associated to unbound port
This fixes a bug where a floating IP associated to a
unbound port would now show the fixed IP of that port.

Closes-Bug: 2047132
Change-Id: I4fbbcc4c0509e74ce3c46fa55e006c5bc3837be3
2023-12-21 11:37:34 +01: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
Akihiro Motoki
5c61331ff2 Django 4.2: Adjust instance detail template
The template for the instance detail overview uses Django template
filters to define a default value for metadata with an empty value.
This usage looks magic and does not work with Django 4.2.
It looks like this is an undocumented/unspecified behavior.
This commit changes it to use {% if %} template syntax instead of
depending on the unspcified behavior.

Closes-Bug: #2040129
Change-Id: Ida5b2a721f2657347c174e386d2e023dffd64b1b
2023-10-23 15:36:49 +09: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
Tobias Urdin
9c75ebba01 Fix allowed address pair row unique ID
This fixes so that the ID for the allowed
address pair rows is unique if it's the
same ip_address range but different
mac_address.

Closes-Bug: 2034035
Change-Id: I49e84568ef7cfbc1547258305f2101bffe5bdea5
2023-10-09 12:22:03 +00:00
manchandavishal
1457628e0e Fix Python3.11 unit test failures
In Python 3.11, regex have undergone changes in
how they handle Unicode characters. In Python3.11,
global flags must be placed right at the start of a
regular expression. The following regex:

        validators.RegexValidator(r'^(?u)[^/]+$')
must become:
        validators.RegexValidator(r'(?u)^[^/]+$')

Closes-Bug: #2036378
Change-Id: I3884ae5b3a32e33077cf3efeac649ac0c615fdda
2023-09-20 21:15:13 +05:30
Zuul
b4554a1951 Merge "Fix ports tab at Launch Instance dialog" 2023-07-26 16:53:03 +00:00
Zuul
47e2d23740 Merge "Fix deprecated use of 'jQuery.fn.select()' shorthand event" 2023-07-26 16:29:01 +00:00
Tatiana Ovchinnikova
50e3e74cdd Fix ports tab at Launch Instance dialog
This patch adds watcher to network ports table at Launch Instance
dialog. It helps to properly load all the information about ports.

Closes-Bug: #2020630

Change-Id: I9949470fb03c423f157df3e6dab59e90c184fa42
2023-07-20 20:26:06 +00:00
Zuul
1bfd8bff60 Merge "Fix object-store container toggle for turning public access on/off" 2023-07-19 17:10:31 +00:00
Radomir Dopieralski
480aba9422 Bump XStatic-JQuery to make it work with jquery-migrate
The jquery-migrate 3 requires newer jquery than we have.
Also added all the other fixes for integration tests to see
if that resolves our problems.

This needs to be merge first so that patch which update the
upper bump of XStatic-JQuery in openstack/requiremensts [1]
can be merged.

Note: This patch also make horizon-integration job to non-voting
so that we can merge this patch and once openstack/requirements
[1] patch is merged, we will make horizon-integartion job voting
again

[1] https://review.opendev.org/c/openstack/requirements/+/887933

Co-Author-By: manchandavishal <manchandavishal143@gmail.com>

Change-Id: I9b8a5e8abe734e7fd99aa0066ede0377e34fbf44
2023-07-10 18:15:18 +05:30
Michel Nederlof
664894a597 Fix object-store container toggle for turning public access on/off
After updating to angular 1.8, changes to a object (in this case the
container object) has changed from the click event to the onchange event
for input radio's and checkboxes as described on
https://docs.angularjs.org/guide/migration#-input-radio-and-input-checkbox-

In our scenario this means the container.is_public value is changed
_after_ the ajax call went to the horizon API, effectively not changing it.

This change fixes this, by migrating to the ng-change event for this toggle

Closes-Bug: #2020879
Change-Id: If3b87da6d747bb7e738b64f4c2f3472a7556c652
2023-07-06 15:32:40 +00:00
manchandavishal
190d38b55f Fix deprecated use of 'jQuery.fn.select()' shorthand event
This patch replace the usage of jQuery.fn.select() with
 .trigger( "select" ) function to fix the
'jQuery.fn.select() event shorthand is deprecated' warning as
recommended in the jQuery docs. [1].

Note: You will get this deprecation warning while creating a keypair
in launch instance workflow.

[1] https://api.jquery.com/select-shorthand/

Change-Id: Ibf0d2020b295108a354d62e1068c4532f12cc103
2023-05-25 11:52:45 +05:30
Radomir Dopieralski
4a89303231 Clean up the syntax of html attributes to always use double quotes
Our templates are very inconsistent and sometimes even use single and
double quotes in the same tag. This is an attempt to clean it up a
little and use double quotes everywhere.

In addition, I have run into a problem with single quotes being
incorrectly escaped by the Django compressor, and I want to see if
this will help with the issue.

Change-Id: I2d5137a87ed65c6abef38a49264346f917a1c85a
2023-04-05 11:00:26 +02:00
Pedro Martins
1db1764749 Add NAT rules to the floating IP workflow
The floating IP workflow is now able to manage NAT
rules (portforwarding) if the floating IP is not
associated with any NICs (ports).

This patch is the one of a series of patches
to implement floating ip port forwarding with
port ranges.

The specification is defined in:
https://github.com/openstack/neutron-specs/blob/master/specs/wallaby/port-forwarding-port-ranges.rst

Implements: blueprint https://blueprints.launchpad.net/neutron/+spec/floatingips-portforwarding-ranges
Change-Id: Id715da6591124de45f41cc367bf39a6bfe190c9a
2023-03-01 10:38:16 -03:00
Andrey Kurilin
c8ee8c1965 Fix applying OPENSTACK_SERVER_DEFAULT_USER_DATA value
The final revision of I86ac21bf82c1667135abd4f20fb4514da0899450 is buggy
and doesn't work.
This commit fixes it and adds a proper test.

Also, this commit updates the docs with a proper horizon version that
corresponds to Zed release (the feature was introduced before final Zed
cut so the author tried to guess the final release number).

Change-Id: Id921b69df13af3cc209236f0446d82dd30e4d8a2
2023-01-26 14:42:15 +01:00
Stanislav Dmitriev
827d453d7a Fix Image Filter for images with None names
Replacing None with empty string to fix non_api_filters
processing if resources have None attributes

Closes-Bug: #2002027
Change-Id: I57493837cede7747bbb634959ace28b2feffb543
2023-01-06 12:40:28 -05: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
452c37dd36 Fix preselection for launch Instance dialog
Launch instance from a volumes/volume snapshot/instance snapshot
should open a dialog with preselected boot source. However the
dialog shows Image as selected boot source in any case, discarding
the preselection.

This patch fixes it, explicitly changing the boot source according to
the preselection.

Change-Id: I1a5a46d7be12ed179474a6a74647d0872b27b492
2022-11-23 15:48:24 -06: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
Akihiro Motoki
516e57bc89 Add UT coverage for attach_interface by port
Previously attach_interface tests in project/instances/tests.py
did not cover the case of attach_interface by port.
This commit adds UT for such cases.

Details:
- The second call of the mocked network_list_for_tenant retured
  an empty list. It sounds tricky to change the return value for
  network_list_for_tenant() in two calls, but this trick was used
  to skip the processing of port_field_data.
  This should return a same value for the two calls to test
  port_field_data() function.
- To test the behavior of attach_interface by "port",
  an unbound port (whose device_owner/device_id of the port is empty)
  is required, so this commit adds it to neutron_data.py.
- test_interface_attach_get() covers a list of choices when "By Port"
  is selected in the form.
- test_interface_attach_post_by_port() is added.

Related to the addition of an unbound port to neutron_data.py,
the following other tests are adjusted.
They assumed that all non-network ports are owned by servers,
but it is no longer true as an unbound port is added to the test data.
Note that associating an unbound port with a floating IP is a valid
operation in neutron, so there is no problem to adjust UTs.

- openstack_dashboard/dashboards/project/floating_ips/tests.py
- openstack_dashboard/test/unit/api/test_neutron.py

Related-Bug: #1943639
Change-Id: Ib0ee342463e5668858078db43c04fe0a1be6e995
2022-10-26 15:34:17 -05:00
Zuul
794472df8e Merge "Handle empty image_type in launch-instance workflow" 2022-10-23 00:57:27 +00:00
Zuul
fade123b22 Merge "Fix success_url parameter issue for Edit Snapshot" 2022-10-21 18:24:45 +00:00
Victor Coutellier
01afd1ba70 Handle empty image_type in launch-instance workflow
Fix the getImageType function to handle edge case
when image_type attribute is present but is an
empty string.

Closes-Bug: 1993579
Change-Id: Ie08cf1010d64ff927515b4792e9b052a76b6344d
2022-10-20 10:33:28 +02:00
Tatiana Ovchinnikova
d0e9e976f2 Fix flavor specification at instance overview page
The details page uses flavor id to resolve instance flavor, relying
on legacy Nova API v2.46. This patch adds the current Nova API
option, resolving instance flavor by flavor name, so flavor
specification at instance overview page is displayed properly.

Change-Id: I1fe45063c9d1cdd8682998329d81f843d30f80b3
2022-09-29 18:49:01 +00:00
Zuul
a0560b4bf5 Merge "Fix "Set admin password" checkbox visibility" 2022-09-27 08:58:18 +00:00
Zuul
443134b54a Merge "Don't try and update port security if its not changing" 2022-09-20 17:43:01 +00:00