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
This commit adds a new action "Edit Port Security Groups"
which jumps the interfaces tab of the instance detail page.
In addition, a warning message is added to the "Edit Security Groups"
form because if a user change security groups as an instance level
the change will be applied to all interfaces of the instance, so
it would be nice if we can provide a good navigation to a page
of editting security groups per port.
Previously, UpdateMembersStep does not support help_text_template option.
To use a bold tag in the added help message, we need to use a template
instead of help_text, so _workflow_step_update_members.html is updated.
Closes-Bug: #1750147
Change-Id: I71437a376b94cab90df0e423aa7e1d2d0d8387ee
This is a preparation for a fix of bug 1750147
to avoid some import circulation.
Change-Id: I4198c3b137976413ebb704d58162b56dbb321a9b
Related-Bug: #1750147
Previously when logging in as a user with admin role,
if we visit "Edit Security Group" action of the instance table,
security groups from all projects are listed.
Change-Id: I71ff940434ef8dc146e934dc833c4d26829930c0
Closes-Bug: #1750140
In Nova Compute API microversion 2.19, you can specify a description
attribute when creating, rebuilding, or updating a server instance. This
description can be retrieved by getting server details, or list details
for servers, this patch adds support for this attribute for instance in
horizon.
This patch adds description for instance update/rebuild
Change-Id: I1c561607551fe6ed521772688b643cb27400e24e
Closes-bug: #1753661
Python3, map() returns a map object. It is better to ensure to pass
an interable object when the value is passed to another library.
It also breaks mock assert_has_calls/assert_called_once_with
because they fails to compare map object and an array.
This commit changes map object passed in
api.neutron.server_update_security_groups into an explicit array
to address this problem.
Change-Id: I4a45489cdbe2f5ca3b17e30f2e62159dd5ab74f8
Partially-Implements: blueprint mock-framework-in-unit-tests
This patch support operation for operators and project users to
associate security groups to a port. The feature is mentioned at
the neutron user feedback session in Barcelona summit [1].
This function UI is same as the function of security groups
association per instance. To realize this, the way of implementation
for 'Edit port' is changed, which move from a single modal to a
workflow base.
[1] https://etherpad.openstack.org/p/ocata-neutron-end-user-operator-feedback (L.35+)
Also we need to display how security groups is associated at a port.
At the moment, there is not way to be able to see it (only this function).
It should be done as an another patch.
Change-Id: I96e0fafdffbf05b8167ec1b85f7430176fdaab90
Closes-Bug: #1637444
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
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
The wording on the Security Groups tab for the Edit Instance window
is wrong. This patch Correcting it.
Current string: 'Add and remove security groups to this project ...'
New string : 'Add and remove security groups to this instance ...'
Change-Id: I76d3afb9174d1428a01dacdc3770a9ebac8f5ce8
Closes-Bug: #1493252
Some general guidelines:
1. Removed contractions
2. Changed "Info" to "Information"
3. Removed the "From here you can..." at the beginning of messages.
4. Explained concepts to users instead of just reiterating the modal
title. Thanks Jeff Calcaterra!
Co-Authored-By: Cindy Lu <clu@us.ibm.com>
Closes-Bug: #1329984
Change-Id: I35af81953cafcbafc28c31b3ce305e8c5e21fe84
In looking at
https://review.openstack.org/#/c/77613/3/openstack_auth/backend.py , it
occurred to me that many other instances of e.message are likely lurking
throughout our code. And especially because Alex Gaynor decided to weigh
in, I think we have a somewhat authoritative view of how this should be
solved.
Change-Id: If00dd70de07ffd278d72c7d5cdf9b0021da4663a
Closes-Bug: 1319918
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
Add the max_length checking for instance name field in Update Instance.
Also changed the max_length value from 80 to 255 in Create Instance
to match the backend's restriction.
Change-Id: I52398a13a545449699a7209db49c06859daa9463
Closes-Bug: #1279590
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.
I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.
I also removed a few unused imports that were revealed in the process.
Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
Fixes all occurrences of this. We have a custom exception handler
in Horizon anyway that only catches ClientException in most of these
cases, but this commit lets us gate on the other cases.
Change-Id: Iea3dc13817f3e5b775b2024424bf3a906da5584b
Closes-Bug: #1211657
The javascript code and template for project membership has been
renamed to horizon.membership.js. It has been modified to take
step_slug as an argument, this is used as the identifier for the
membership step variables - for supporting multiple membership step
in a single workflow.
Also, removed unused template, tables and views.
Change-Id: I8685a307006cabc7005def160875c844e24c60ef
Fixes bug 1208558
blueprint quantum-security-group
Rule table view
* Add direction and ethertype columns (which are specific to Neutron)
It may be better to hide "Direction" and "Ether Type" columns
unless Quantum security group is enabled.
* Merge ip_protocol/from_port/to_port into one column for better view
* Use "::/0" for IPv6 ANY instead of "0.0.0.0/0"
* Rename "Source" column to "Remote".
(The naming "source" does not fit egress rules)
* Display security group name in the title of rule detail view
Rule creation form
* New arguments 'direction' and 'ethertype' in security_group_rule_create()
* Set the default value of 'direction' to 'ingress' in forms.handle()
* Rename 'ip_protocol' to 'rule_menu' and 'source' to 'remote'
Note that rule_menu is retrieved from rule.ip_protocol in the unit tests
since they are tests for custom TCP/UDP/ICMP rules.
Network abstraction layer for security group management
* Move security group methods to api.network
* Add Neutron security group API implementation
* Move base classes for network abstraction to a separate module
(api/network_base.py) to avoid circulated import between
api.network and api.nova/api.neutron
Add a configuration parameter to control Neutron security group support
* Neutron security group support is enabled when Neutron is enabled and
enable_security_group in OPENSTACK_NEUTRON_NETWORK in settings is True.
* Not all neutron plugins support security group, so we need a way
to control neutron security group is enabled or not.
* It can be determined by supported extension list from Neutron
and it is a possible future work.
Move get_int_or_uuid to openstack_dashboard/utils/filters.
* get_int_or_uuid is now used in security_group implementation as
well as floating IP logics.
* In addition the depth of the directory tree becomes longer and
it is hard to fit the import line in 80 chars.
It is a good chance to move it to a common directory.
Add __repr__ to API**Wrapper to make it easier to debug.
Limitations:
Neutron supports per-port security group. security groups can be
associated with a port instead of an instace and each port can have
a different set of security groups. It is not a scope of this BP
and is a future work.
Change-Id: I5410e88043a364596037b9ebcc566cd50b317614
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
In the move to make flake8 tests stricter, we need a code
cleanup earlier.
This removes all unused imports and also enables tests to prevent
them for the future.
This patch also includes the checks on __init__.py files.
Change-Id: I34055803f7c4726682ac6fb95cc5b50ba761fec8
Fixes: bug 1188134
We should use ugettext_lazy to let users in different languages
get correct translation.Though in views or similar places
we can use ugettext with no problems, we should make code
style consistent.
This also fix the issues that the django proxy objects appear on the
launching instance page instead of translated strings. Now the
translated quota strings are handled correctly.
Fixes: bug #1178722
Change-Id: I76f0d31e6546d70e5ece7e86a06f7eefd04861d2
Changes the edit instance dialog into a workflow, and adds a step
"Edit security groups" that reuses the admin:project add/remove user
dialog.
Changes:
- Allow "roles" dropdown to be hidden.
- Moved project members template into horizon/common.
- Moved workflows.py to workflows/create_instance.py so I could add
a workflows/update_instance.py.
- Moved hardcoded UI text from js to template/workflow definition.
- Made filter-fields use placeholder attributes.
- Fixed the #add_remove being added to the URL bar when adding/removing
members.
- Fixes the project members modal getting stuck displaying the lists
from the first invocation of the modal and never updating
(try clicking "modify users" for different projects).
Implements blueprint add-security-group-to-instance
Change-Id: If2939e05c92ac50bfc3c6f0112bdfc1785d9fb4e