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
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
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
'unnecessary-comprehension' warning is emitted when
unnecessary use of a comprehension is found.
classes attribute in Action can be a tuple,
so we need list() to ensure it is a list before adding 'disabled'.
I think it is time to introduce a method in Action class or somewhere
but it should be handled separately.
Change-Id: I16a98d56b6d0bd0af234b00735c6ed576620df7e
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.
Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
(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
DeleteActiona and BatchAction in the network, subnet and router tables
are improved using handle_exception_with_detail_message decorator.
There is no need to have separate delete action in the admin network
and subnet tables now, so they are merged into the corresponding delete
actions in the project tables.
Change-Id: I976e4e6ed8e9c1430f82ac362c080853744b5d07
Closes-Bug: #1733207
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
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 column showing the availability zones for which the router is
scheduled in.
Change-Id: I87f6bfcee1f129a77e6bf9efa973a79bfa2afe14
Partial-bug: #1716638
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
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
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
Adds a word-break class that can be added to tables to prevent large
column values breaking the table shape.
Change-Id: Icca10d9c29254d176dc7f8b7c039bc19c3f52c72
Related-Bug: 1565724
Closes-Bug: 1584785
A button should have either btn-default OR btn-danger ... not both.
This also removes the flashing red change this problem caused when
adding a 'disabled' class to the button after its already been
rendered on the page.
Closes-bug: #1557729
Closes-bug: #1549957
Change-Id: I6e035868be4df653438b4d31b462729c3fe06d9f
Create both test for router create/delete and router Page Object. Also
decapitalize routers table name so it could be referenced in
integration tests like any other table.
Change-Id: Ic4fdfa82584dd3cad1e906d5fc5526c4a758675f
Enables the translation of the status on
network topology.
Provides a json decoder that will resolve
lazy objects like translations.
Moves STATUS_DISPLAY_CHOICES and
ADMIN_STATE_DISPLAY_CHOICES out of the RoutersTable
for easy access to their status from other parts
of the code.
All network objects have their status translated
and a new item called original_status which provides
the untranslated status so the javascript code
is able to display the proper image (green/red)
based on the original status instead of doing it
on the translation.
Change-Id: Ic8cebafe7fbc291fa8933e8d1c2a244be20128e3
Closes-Bug: #1323599
Closes-Bug: #1484113
In some of the dashboard 'views.py' files, there is code that enables
the detail status and, when applicable, admin state labels to be
translated. The current coding style of these sections is hard
to read. Any and all sections of code that use this style should
be refactored to enhance the code readability. This change
proposes to create a single utility method that handles this
repetitive code block that is used in many places. Thus to perform
the translation label lookup, this method need only be called. This
method will provide a single clean and consistent code block that can
be used for any of these situations in the future.
Change-Id: I6353abef58fc2a481d4379eb1a2f8289d7f1790b
Closes-Bug: #1490031
if OPENSTACK_NEUTRON_NETWORK["enable_quotas"] = False buttons will not appear
and exceptions are thrown. This is because a dict is searched for a key
("available") which wont be there if its disabled. This generates a
KeyError at runtime.
As currently written enable_quatas -> False essentially disables Neutron usage.
This is not a desirable outcome.
This patch shows Neutron related buttons and ignores the quota settings,
which seems more in line with the notion of disabling quotas.
Closes-Bug:#1482354
Change-Id: I9485ddeece74d87317c2587498f5f79d4ffdb66e
admin state column is missing in router
table.
this patch is added the admin state column
in router table with the display choices
to translate the values
Change-Id: I9653ded182e9070f22249be53f7b9b6397c43b54
Closes-Bug: #1421166
Add appropriate help text to some important batch actions.
NOTE:
The another patch:
https://review.openstack.org/#/c/139920/
to add appropriate help text to some important delete actions.
Implements blueprint: add-batchactions-help-text
precondition blueprint: make-batchaction-help-text-configurable
Change-Id: Ide21a4fbcb327ed7edfc98f3e36b54aa527e0084
in router table, the value of status
column is not translatable.
this patch added a display choice for
status with translatable option.
Change-Id: I560591b8ad4112b868da0e0015720dd4a5ac4bf0
Closes-Bug: #1420287
client side filter is missing for
network and router tables on both admin
project.
this patch adding the filter for both
network and router tables.
Change-Id: I27027da70b8b1e1e50ecfa414fa19a14e11064d7
Closes-Bug: #1413550
There are several places where "-" or '-' are not translated strings.
There are others where they are. This should be consistent. I can see
value in being able to translate "-" to another character.
Closes-Bug: #1398892
Change-Id: Icfcd20fb597122d8efa30debf9f6e7273f036419
This change removes all attached interfaces from a router when it
is deleted from the project dashboard. This was only being done when
the router was deleted from the admin dashboard.
Change-Id: Ic0b639bfad7451bb5acbf486c39e349c938723db
Closes-Bug: 1384400
Added quota checks for security groups, networks and routers. If quotas are
exceeded then buttons to create are disabled and feedback is given to the
user.
Appropriate tests are also in place
Change-Id: Ie49db5397d87a0c9a583b64e5de34460144b5956
Closes-bug: 1278449
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
Fix adds a mixin to replace the replicated get_policy_target
function. Duplicated code is removed from many classes and mixin is
inherited.
project_id, user_id and domain_id are now default in the generated
policy_target dict but are set to None if the data doesn't support it,
this is to provide the most flexibility for operators writing policy.json
as discussed in the bug report.
policy_target_attrs attribute added by the mixin is overwrittable by
sub-classes of the mixin to override the defaults for custom policy_target
information.
Change-Id: I26759f145b8756bd1eef585c8107160277061523
Closes-Bug: 1317238
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
Warnings H904, H307 and H405 are new or considerably changed, and will
be fixed in a separate patch.
Closes-bug: #1349820
Partial-bug: #1347472
Change-Id: I4fd28990dacf16f03a4eaa6074ef59c37f1a2c14
Updated to bootstrap 3.2.0
back to v3.1.1
fix base-line-height variable
Revamped grid system
Replaced help-inline with help-block
Change .control-group to .form-group
Add column widths to horizontal form labels and .controls, remove .controls class
Datepicker form fix
Add btn-default to btn elements with no other color
Topbar switcher fix
Rename button sizes
Replace alert-error with alert-danger
Removed alert-block
Alerts fixing
Updated LinkAction and Action table actions to define icon, replaced btn-default icon with glyphicon
Replaced icons with glyphicons, removed btn-icon styling from horizon.scss
change Button Icons text in customizing docs
Fixed table header
Fix page_header h2 margin
Nav accordion fix
Tables fix
Modal fixes
added form-control class to input and selects
Forms fixes
Workflow modal fix
Fix quota bar
updated customizing docs
removed unused styling from horizon.scss
make datepicker form inline
fix table filter styling
added btn-danger to terminate instances button
fixed loading spinner
form fields and validations
Created bootstrap_form_field filter and template to render bootstrap forms properly
Style up the datepicker
Fixed failing test cases
Implements: blueprint bootstrap-update
Change-Id: Ic826849be1af7fc6bf06f97dd7a60fc54b862148
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
Policy checks for all actions on firewalls, loadbalancers, network_topology,
networks, routers and vpn panels.
Co-Authored-By: Lin Hua Cheng <lin-hua.cheng@hp.com>
Change-Id: Id12257d3200f8af6ff590fd576c4cb6e414b455a
Implements: blueprint network-rbac
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
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