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
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 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
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
Right now, even if we specify a ::/0 (or other IPv6) CIDR in an
ICMP rule, Horizon sets 'icmp' as the ip_protocol of that rule but
neutron expects 'ipv6-icmp' which is the right ip_protocol for ICMPv6.
This results in that rule never matching anything.
This change makes Horizon set the ip_protocol to ipv6-icmp when
the CIDR is an IPv6 one, and icmp when it's IPv4.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I1f68e1e5a3e073e38ac258de5ed9c43f8acb04e9
Closes-Bug: #1652619
This commit mainly covers settings
in openstack_dashboard/dashboards/project/.
Part of blueprint ini-based-configuration
Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
When selecting the remote as CIDR,
the CIDR value field is mandatory but isn't marked as mandatory.
This patch marks it as mandatory.
Change-Id: I2125813d6fb58e311b6bef821a88c78ab0fc6cfc
Closes-Bug: #1816330
openstack_dashboard/dashboards/project/security_groups/forms.py:393:13: R1714: Consider merging these comparisons with "in" to "rule_menu in ('tcp', 'udp')" (consider-using-in)
openstack_dashboard/api/rest/json_encoder.py:61:15: R0124: Redundant comparison - o != o (comparison-with-itself)
openstack_dashboard/api/keystone.py:904:15: R1714: Consider merging these comparisons with "in" to 'default in (role.id, role.name)' (consider-using-in)
horizon/templatetags/truncate_filter.py:30:7: R1716: Simplify chained comparison between the operands (chained-comparison)
Change-Id: I6cf8602f88c4027ff12aaa4ea5a9f2069ae2e2a6
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
https://review.openstack.org/#/c/552247/ introduced a way to
add asterisk mark to conditionally required fields.
This commit covers several known forms:
- Create Network / Create Subnet
- Create Port
- Attach Interface to Instance
- Add Security Group Rule
Change-Id: I809c23fd64dc2f379c3fdb585741c6b266ec5b1b
Closes-Bug: #1420370
Closes-Bug: #1292165
Closes-Bug: #1755131
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3
blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
In Neutron API icmp_type/code are not required fields,
so they should be optional.
Previously we support Nova API which requires icmp_type
and icmp_code but we dropped Nova security group API support in Pike
and we no longer need to care it.
Change-Id: Ie460e763928b4f50f84c38d88556df632078ba42
Closes-Bug: #1712025
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
This commit drops Nova security group dependency from
the dashboard implementation.
security group support in the nova API wrapper will be dropped
in a separate patch.
Also removes api.network.security_group_backend()
as it is no longer needed.
Partially implement blueprint drop-nova-network
Change-Id: I224010eb59068a7cc4f97c2453d499adde7644b4
Neutron allows setting port or protocol wildcard by not specifying any value
for them.
Example, these are allowed by neutron:
neutron security-group-rule-create --direction egress <sgid>
neutron security-group-rule-create --direction egress --protocol tcp <sgid>
Specifying '-1' for IP protocol means a wildcard IP protocol.
validate_ip_protocol is updated accordingly.
'All ports' choice is added to 'Open Port' field.
Change-Id: I4a7262eda89e3206c743fee14c78aa6b49308ce6
Closes-Bug: 1669467
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.
After this, there are only 3 noqa under openstack_dashboard/ :)
Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
Some places are not using ThemableSelectWidget, so
these select ui is not themable. This patch fix it.
Change-Id: I303a9cf8c6f8f651edf68973a2f5e16a8b04b26d
Closes-bug: #1669696
This patch moves the Security Groups tab from the Access and Security
panel into its own panel under the Network panel group. As this is the
last tab in Access and Security, that panel is also removed by this
patch.
Change-Id: Id29c7ce635d46383742aec140def265d4b249aa5
Implements: blueprint reorganise-access-and-security