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
The name is not required, so data["name"] may be empty.
When data["name"] is empty, get the id value.
This patch correct error messages on create and update form
Change-Id: I9d5eebf65501c5e182a9a135c97461ff3fcf57e7
Now only workflows.py in project/networks/
has the tooltip for "admin state".
Since "admin state" is confusing, there should
be tooltips for wherever it appears.
Change-Id: Ib075efd46af6c8f0d0d61b4ac76160d8de08b77d
The name is not required, so data["name"] may be empty,
but the router.name_or_id must have a value
Change-Id: I0b20d0ab5ff66e199faa58cb9146aa731552c698
(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
On the project creation router page, if we don't check "Enable Admin
State" option, when the router is created, "Admin State" is displayed
as UP. This inconsistency is because the judgment condition of [1]
doesn't hold which causes the "admin_state_up" parameter not to be
passed by the call creation router interface. In this case, the
back-end defaults to "admin_state_up" to be UP.
Since the router "Enable Admin State" option has an initial value of
True, there is no need to check for [1].
[1] https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/routers/forms.py#L121
Change-Id: I6b95ffa680eab5c29d2bca6c91fc7f028f7f519a
Closes-Bug:#1748777
In project create router form, when creating router with the external
network, there is no need to determine "ext_gw_mode_supported" since
the "ext_gw-mode" has been checked when the form is initialized.
So, we need to delete it since it's also undefined.
Change-Id: I6dc221638ccda2a8819776679735685cb3c61d56
Closes-Bug:#1733047
When creating a router, or when setting a gateway on a router - a checkbox
is displayed, which can be unchecked to disable SNAT.
Change-Id: I8bc040018645fe2bde534b7d48e14c17984cc9c4
Closes-bug: #1673076
This patch adds a try/except around all api.neutron-calls that are not already
covered by exception handling.
Change-Id: I5da17414ea932def6f2a21b2a8dca981e755cca6
When 'availability_zone'-extension is enabled, we present the user with
a drop-down menu containing a list of available availability zones.
This sets the 'availability_zone_hints' parameter on router creation.
Change-Id: I96293202ddd855823e89c4c7ba0b1f6a6423aab2
Partial-bug: #1716638
In horizon design we don't show IDs as they are not user friendly,
but forms in the network and router panels show ID as read-only fields.
These fields are only used to retrieve ID of target or parent resource,
but they can be retrieved from "self.initial". (Note that 'initial'
data is set from url parameters in the django views.)
We don't usually show resource name of parent resource as well.
Let's do it consistently for network/router forms.
Change-Id: Ibd4c594e79889e8c605203a79bc35e1ffaa40703
Closes-Bug: #1671593
admin_state_up is a boolean value but the network and port edit forms
expected a string version of True/False. As a result, True/False string
was shown as the default value in these forms. The field is implemented
as ChoiceField, but there is no special reason not to use BooleanField
for a boolean field and admin_state(_up) fields are the only exceptions
in horizon. This commit replaces all admin_state(_up) fields to
use BooleanField.
As far as I checked, this pattern is used only in the networking
related panels and this patch clean them up.
Change-Id: I9286f6c29d67fec7a88b74661bc8eca945fd9061
Closes-Bug: #1672213
Previously translated messages are included in log messages
and it was determined what language is chosen by users.
It makes difficult for operators to understand log messgaes.
This commit tries to use English messages for all log messages.
The following policies are applied based on the past discussions
in the bug 1406333 and related reviews.
- English messages are used for log messages.
- log messages include exception messages if possible
to help operators identify what happens.
- Use ID rather than name for log messages
as ID is much more unique compared to name.
- LOG.debug() in success code path are deleted.
We don't log success messages in most places and API calls to
back-end services can be logged from python bindings.
Change-Id: Ie554463908327435d886d0d0f1671fd327c0cd00
Closes-Bug: #1406333
Based on Diana's work.
Complete for Admin Panels: https://review.openstack.org/#/c/290204/
Horizon used a standard select input. Unfortunately this type of
input is only customizable to a small extend. Note: not all
ChoiceFields were converted because they have unexpected
impact.
Change-Id: Id9405c6f0127d6e86db09dfaf772f1275a7d7547
Partially-implements: blueprint horizon-theme-css-reorg
When creating a router with an external network attached
from the Create Router form a router namespace doesn't
get created on the controller.
By calling the correct APIs, the namespace get
created.
To check the namespace list run the below command
on controller node.
'sudo ip netns list'
Change-Id: I829c707353830ff808b6f6a0b29ccedeca588616
Closes-Bug: #1535707
In update router modal, the router id textinput
is hidden. since duplicate router name is allowed,
it is difficult to differentiate.
This patch is making the router id field visible
and readonly.
Change-Id: I898bdc7a92b011ce61ab0375e04d81d82a83a313
Closes-Bug: #1421589
In create router form some optional
parameters and help text is missing.
This patch is adding the admin state
and external network parameters and
help text.
Change-Id: I36295a70f25f7e09a89d78aff07643e89c52ba2f
Closes-Bug: #1421128
In several panels the network admin state is hardcoded to UP/DOWN,
this patch aims to make the admin_state translatable.
Change-Id: Ia0e5ba02a4980c1db0d914e2689956feee5fb718
Closes-bug: #1390207
HA (high availability) mode support is one of the important topics in
Neutron Juno, and this patch adds HA router mode support to Horizon.
This commit also changes the default value of enable_distributed_router
in the example local_settings.py to False. In Juno release of Neutron,
the distributed router and L3 HA mode cannot be enabled at the same
time and only L3-agent deployment with L3 Router service plugin
support both features. Thus I believe it is reasonable to make both
options default to False to avoid unnecessary confusions to operators.
Closes-Bug: #1370110
Change-Id: I77b0292b761f08b4580846f6d58443f7df9a1f6b
The Admin State choices in create forms throughout horizon
were not very clear, this patch presents that choice in a much more
readable and understandable way. The field is changed from a boolean
field to a choice field with the different states, making it more
obvious what is being decided.
Change-Id: I7091e5ccf91c57d3f64e2d4415bed952d09ada71
Closes-Bug: 1370322
Neutron DVR implementation allows to change router type from
centralized to distributed. This commit adds "Edit Router" form
which is not implemented so far to allow this feature.
This commit also adds:
- admin_state field to the router detail.
- documentation on a new option enable_distributed_router
Completes blueprint enhance-horizon-for-dvr
Change-Id: I4b46e44c417726217ed034e305827b102ba656f8
Feature completed :
1. Admin router panel
+ New "Distributed" column introduced.
+ New Field "Distributed" added on to
router detail panel
2. Project router panel
if logged in as "Admin"
======================
+ New distributed column introduced.
+ New Field distributed column added on to
router detail panel.
+ New Router Field dropdown box introduced in
create router form.
if logged in as "nonAdmin"
=========================
+ Router Type dropdown will be invisible for
non admin.
+ Distributed information will be
hidden from details panel.
implements: blueprint enhance-horizon-for-dvr
Co-Authored-By: Akihiro Motoki <motoki@da.jp.nec.com>
Change-Id: I995745dd72a8b750866c0977a7d7cf42036f716f
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
Changed error message to show when the router creation
fails due resource quota restrictions.
Change-Id: If5a43d4132adc653694cc42c3d658ca2d88adc33
Closes-Bug: #1278482
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
Now all files are properly licensed per OpenStack Hacking.
Change-Id: I223d983018568357197b0d9cf5dde12c135c53c9
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
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
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
Implements bp quantum-l3-support
Implemented basic CRD for router
Add/remove interface support
Support set gateway and clear gateway
Change-Id: Ie4cac962eb8fadc021c80cf05e2aa63caab3c00a