- FloatingIpManager.get_target_by_instance was dropped in [1],
but it remains in a docstring.
- "label" argument of FloatingIpTarget.__init__ can be None [2]
and it is an expected behavior in the initial design.
From the maintenance perspective, it would clarifies the meaning
if it is marked as optional.
[1] commit cd9a14d293
[2] a05b326e42/openstack_dashboard/api/neutron.py (L740)
Change-Id: I813041a60d211164cdc3fa17e2b0e768d1ffd080
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
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
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
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
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
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
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.
Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
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
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
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>
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
code in neutron api in some circumstances tries to access
a set or a frozenset by index, which does not work.
In particular it may manifest as
Unable to connect to Neutron: 'frozenset' object has
no attribute '__getitem__'
error in the horizon.log when opening an empty instances list page.
Convert to list instead, and skip conversion for `collections.Sequence`
objects only that support all the methods used for this object
further in this method.
Closes-bug: #1825961
Change-Id: I141a28d96f71c06a1ebe44d7067ccf4609e22db6
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
Add RBAC Policies panel to support Role-Based Access Control
functionality.
Implements: blueprint rbac-policies
Change-Id: I883ad629d735dadf49e8bf9c50475050fdfcf797
In python3 we cannot compare None with an integer,
while this works in python2.
Change-Id: I1321ea68f08241db377a58ed6a22306c63aba204
Closes-Bug: #1789402
Previously, when a network name is an empty string,
network information of server interfaces will be empty,
so we cannot distinguish server interfaces.
Also network name in the instance detail page is capitalized
but there is no need to capitalize it and such information like
network name should be displayed as-is. This is not directly
related to the bug fixed by this commit, but it is simple enough
and related to network name, so I believe it is okay.
Change-Id: I2f2ad9b6bf50a2b53e79e4929d877111f875bd5b
Closes-Bug: #1805812
Previously instance ports without IP address were not shown
because api.neutron.servers_update_addresses() ignored ports
without IP address.
This commit changes servers_update_addresses() to include
a special symbol (None) representing "No IP address"
in "addresses" attribute in "server" object.
"(No IP address)" will be shown for ports without IP addresses now.
Closes-Bug: #1804016
Change-Id: I46699731ab515667b8cdf97ef68bdb8cbfe0b563
Fix the following new errors:
* E305 expected 2 blank lines after class or function definition, found 1
* E126 continuation line over-indented for hanging indent
max_line_length is set to 80 as the default value in pycodestyle is 79
but horizon uses 80 as max_line_length.
Ignore W504 and F405 by configurations.
Reasons of disabling them are explained as comments in tox.ini.
Change-Id: Iee8bcd60c30883fc8c74f08cf20af853cbb5e271
The exception handling for port, floating IP's or networks
is too broad. Add specific error handling and in a case when
the resource is not found do not raise a invalid message.
Change-Id: I98ee2ff816c03980645752eebb4e39d3ecd2e158
Closes-bug: #1796565
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
Code was incorrectly removed from the final patchset where the delete
action was implemented for the qos panel. This results in an error
occurring when users try to delete a policy. This patch removed this
error and restores normal and expected functionality.
Change-Id: I7f4c221fd48e5fd5c268f5150ae6f3ed2bf1bacd
Closes-bug: #1785809
This adds support for the "DNS Domain" and "DNS Name" options to the
panels for listing and allocation Floating IPs.
These options are available as a Neutron extension, so we need to
make them conditional based on the availability of that extension.
Change-Id: Ife8e19aac44dccbdf11a6a6d4bb50cd3b7ed8d8e
"Get-me-a-network" feature is supported in Nova API 2.37 or later.
To support this in horizon, a dummy "auto_allocated_network" is shown
in the launch instance form. I believe this approach fits the current
way of the launch instance form. The dummy network is a special network ID
and if specified the nova API wrapper converts 'nics' parameter properly.
In addition, a dummy "auto_allocated_network" is now shown in the network
table. This is because Neutron creates an actual auto allocated network
once a server is created specifying nics=="auto".
I believe this fake behavior brings consistency in the network table
to some extent, while this is just a compromise.
Note that this patch does not cover the network topology integration.
"auto_allocated_network" is not shown until the actual auto allocated
network is created. The network topology integration requires more work.
For example, the link for the fake auto allocated network should be
disabled in the flat view. The pop-up for the fake auto allocated network
should be disabled in the graph view.
Change-Id: I062fc1b7ed75dc771ddc7f13c8324ed4ffab6808
Closes-Bug: #1690433
This patch fixes Bug #1742332 (Security Rule Description neither
editable nor shown). I have added the option for a description
to be added to a security rule which will show the description
on the related table.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ie723deb412977ae460c1e897f5d71fc8dbb7a853
Closes-Bug: #1742332
Also improves the warning message of UnhashableWarning
and test_neutron UnhashableWarning.
Closes-Bug: #1747204
Change-Id: I876e3219dac570e8f7b10c5c126df74ca73f5197
When adding a new rule to a secruity group that would exceede the
quota, the error message displays a quota error, rather than rule
already exists error. It does this my first checking for an
"OverQuotaClient" error, then if that except doesn't trigger it
checks for any other conflict
Change-Id: I8eaa0f00b25c8c3b75fef2bf46979f1f248c6896
Closes-Bug: #1699724
Neutron provides an API to retrieve default quotas since newton.
Unfortunately there is no corresponding neutron API extension
is not defined, so there is no way to detect it via API.
The API exists since newton, so this commit just switches to
the default quota API.
Closes-Bug: #1337473
blueprint make-quotas-great-again
Change-Id: Ia826b67f4cec7d95335c62ef98c3040feaa06117
The networking API supports setting a description on floating IP addresses.
This patch adds a form input field to the allocation form, and a column to the
table that displays floating IP list.
Closes-Bug: #1738625
Change-Id: I3cec286d01f319402dd652f2f0fe7a59e7d1cfbb
Previously neutron did not provide a way to retrieve resource usage
in a single API, so we need to call list APIs and count the number of
resources. Since Pike release, quota details API is provided and
it returns both quota and usage (used + reserved).
blueprint make-quotas-great-again
Change-Id: I63d0e81654c18f0f235631922d64d1109233fcfa