Commit Graph

11 Commits

Author SHA1 Message Date
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
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
Marek 161b4ae5d4 Fixes a series of bugs related to Floating IPs.
- Fixes KeyErrors when accessing 'floatingip' values in usages, which
  broken Floating IP allocation.
- The quota display in the bottom right of the Allocation dialog are
  only displayed if 'enabled_quotas' is True
- Adds security group rule tallying for the usages overview page, which
  fixes a KeyError crash for installations where Horizon 'enable_quotas'
  is set to true, but the 'quota_details' extension is not installed on
  in Neutron
- Adds a policy check to show and hide The plus/add button in
  Instances->Associate Floating IP to match the Allocate IP To Project
  button in Floating IPs
- Fixed the page title not being set for the non-modal version of the
  modal allocation dialog/form
- Added an 'allowed' functionality for network usage overview charts to
  allow for them to be dynamically disabled
- Added tests and mocks for the above
- Added tests for non-legacy quota tallying for networks
- Added test for disabled network quotas in overview

Change-Id: I47f73ff94664d315a2400feb8ce8a25f4e6beced
closes-bug: #1838522
2019-12-17 13:30:25 +09:00
Jens Harbott 9e703aec2f Add DNS parameters to Floating IP panels
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
2018-07-22 20:24:36 +09:00
Zuul 98d0714939 Merge "quota: Use network quota field names consistently" 2017-12-26 21:40:34 +00:00
Trygve Vea d1225c606e Floating IP: Expose description field in form and tables
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
2017-12-17 12:58:50 +00:00
Akihiro Motoki 1340904d47 quota: Use network quota field names consistently
Previously neutron quota names and nova-network quota names are
mixly used and this makes the readability terrible.
We no longer supports nova-network, so it looks simple to use
neutron quota names consistently.

Neutron quota names use singular form and it is different
from nova and cinder (which adopt plural form as quota names).
Although it might be confusing, the mixed usage is much worse.
Some wrapper layer may address singular vs plural form issue,
but it can be solved later. Let's use neutron quota names
directly now to simplify the code.

blueprint make-quotas-great-again
Change-Id: Ie31414ada34cbdbd046063b512d3cef0a6e68acf
2017-12-13 20:27:02 +09:00
Mykhailo Dovgal ca0f293cb6 Fix tenant_quota_usages function calls caching
This patch changes type of 'targets' input parameter in
tenant_quota_usages function from list -> tuple. It provides
possibility for @memoized decorator to cache function calls.

Change-Id: I3c32c3b65ae91e8487fda6148f259fe1931d7c9f
Closes-Bug: #1700578
2017-06-26 17:36:07 +03:00
Akihiro Motoki 359467b401 Retrieve quota and usage only for resources really required
tenant_quota_usage() is used to retrieve quota and usage
to determine if a resource can be created.
However, tenant_quota_usage retrieves quota and usage for
all resources and it can be a performance problem.

This commit allows to load quota and usage only for resources
which are actually required.

Closes-Bug: #1675504
Change-Id: Iab7322a337a451a1a040cc2f4b55cc319b1ffc4c
2017-06-14 08:53:32 +00:00
Akihiro Motoki 9067ae8b0f Move SG and FIP API wrapper to api.neutron
We no longer need to have SG and FIP API wrapper in api.network
as we only supports a single network back-end.

Completes blueprint drop-nova-network

Change-Id: I4e59d897508b497a3cd2ae2fda93b30b786610dc
2017-06-04 17:51:25 +00:00
Rob Cresswell 99849ad88f Move Floating IPs from Access & Security to panel
This patch makes the Floating IPs tab in Access & Security its own panel
under Project > Network

Change-Id: Ibb83ae5a0448d2824c10f867e620cec8219b7b72
Implements: blueprint reorganise-access-and-security
2017-02-01 18:57:44 +00:00