Commit Graph

32 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
Akihiro Motoki ec970fd6e8 Handle partial dict setting
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
2019-09-26 14:31:17 +09:00
Akihiro Motoki 53486be43f Define default settings explicitly (openstack_dashboard 2/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/admin/.

Part of blueprint ini-based-configuration
Change-Id: Ifb3e9401a926ba9e035e1b498a4a4493c1b594f5
2019-04-24 02:32:47 +09:00
Vladislav Kuzmin 19a6c9bc61 Add "Create Router" button to admin panel
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I623acbad9a326845603c7a9f480d05265d5b279e
2018-11-05 09:10:08 +09:00
Akihiro Motoki e477eafa45 django2: Replace django.core.urlresolves with django.urls
(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
2018-02-17 01:36:48 +09:00
wangliangyu 00ecfcdb0b Filtering networks or routers by non-existing tenants return an empty list
When networks or routers are filtered by a tenant which does not exist,
there will be return a list no filtered. But we expect an empty list.

Change-Id: I8faca01ab67240a76818d6752f796a6de3c51b5f
Closes-Bug: #1744846
2018-02-08 15:27:02 +08:00
Adit Sarfaty 245da1d812 Do not call list_l3_agent_hosting_router if not supported
For the admin router view, list_l3_agent_hosting_router is called.
If this extension is not supported, it returns "resource not found"
and an error popup.
This api should not be called in case the extension is not supported.

Closes-bug: #1708081
Change-Id: I38f7386689d95dde3fc76bbf4d6b5e781b515878
2017-08-03 08:16:54 +03:00
Rob Cresswell 560f23a1c9 Add default common template to python table views
Many of the Python table views are using identical (or nearly identical)
table templates. This patch adds a common template and makes it the
default for a DataTableView, which allows us to remove many similar
templates and redundant lines of code.

Change-Id: I1e4e15e695ee1f21f4d44f141a854e30f1e567a1
Closes-Bug: 1653986
2017-01-05 08:59:35 +00:00
Luis Daniel Castellanos e15b61f58a Update admin filter first setting to a dict
Previously the ADMIN_FILTER_DATA_FIRST setting was a True/False
setting that was taking over all the admin views leaving
operators without the opportunity to set this setting to views
individually.

This patch changes the setting to a dict where it can be specified
which panels/views will implement this setting individually.

Implements blueprint: admin-views-filter-first

Change-Id: I50deab878f68c1cc519aa9b47feaa2c58bb8eacc
2016-09-14 15:52:20 -05:00
jlopezgu f1cce3aa8e Implements filter_first in routers
Add the filter_first feature to routers admin/project views.

Implements blueprint: admin-views-filter-first

Change-Id: I6836a322031231036ea8b2092f26706da2e6d384
2016-08-29 14:26:55 -05:00
jlopezgu 02594a758f Server-side filtering routers
Implements server-side filtering for routers:
  - Admin->System->Routers
  - Project->Network->Routers

Implements blueprint: server-side-filtering

Depends-On: Idaee431ed15de81e5ea049948b55d1526e2024ac
Change-Id: Ic93ce6d2a73f33e639a9a3fa0f8846a7d1cbbe9a
2016-08-09 13:58:51 -05:00
eric 0ee88956cc Add router L3 agent info to info page
This change tries to lookup the L3 agent location for a router
to assist admins in locating where a router resides.

Change-Id: I62bedcc587791df3a101b9d81a03ba2540dfa033
Implements: blueprint admin-neutron-l3-agents
2016-05-31 12:31:30 +00:00
eric 25b1aa86fb Adding admin lookup of routers per l3 agent
This change allows admin users to find out which routers are
located on which neutron l3 agent.

Partially implements: blueprint admin-neutron-l3-agents

Change-Id: I078ba0a1e6545196c578c8e59d35720c499c301f
2016-05-13 02:14:37 +00:00
Rob Cresswell f38ddf2032 Add breadcrumb to more details pages
This patch adds basic Breadcrumb nav to the detail pages for Data
Processing, Databases, Metadata Definitions and Routers.

Change-Id: I114e93799b957db39cbe0d4e49d3e6869bc9d92d
Partial-Bug: 1413823
2015-11-09 20:55:12 +00:00
Masco Kaliyamoorthy ffae6e6757 Corrected wrong url in router detail page
In router detail page, the link to the network detail page
redirecting to admins panel. so the non admin users not
able to access the network detail page from router detail page.

Change-Id: If6d70dcb214b9557d8501b9252b75fbfd9add248
Closes-Bug: #1504123
2015-10-08 18:52:22 +05:30
Rob Cresswell 49e40509eb Fixes inconsistent Edit between tables & details
This patch addresses several instances where clicking Edit on a Detail
page (such as Edit Port on the Port Detail Page) gave either more or
less options than the equivalent action in the Table. This patch fixes
any occurences so that Edit ___ show the same form and fields regardless
of where it is clicked

Closes-bug: 1408346
Change-Id: Ic2599d594b627bd7ab584d1a314360921e41a203
2015-03-23 10:43:47 +00:00
Rob Cresswell fa649e9edd Refactor modal forms for Routers
Refactoring Routers modals
Based on merged patch: https://review.openstack.org/#/c/123472/

Change-Id: I6cbc06843e57f10073407a0a69b5884f8e06b840
Partially-Implements: blueprint form-template-to-view
2015-02-17 16:22:32 +00:00
liyingjun 403b81db29 Replace set_id_as_name_if_empty with name_or_id
we can replace set_id_as_name_if_empty with name_or_id in
in all neutron related place to reduce a extra loop call
since set_id_as_name_if_empty is called every after *_list.

Change-Id: I341adb3a581337790e22e049e5b72df11b462b44
Closes-bug: #1370986
2014-12-09 09:57:28 +08:00
Akihiro Motoki 6a8ea3385c Add "Edit Router" to allow to change router type
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
2014-08-30 05:01:25 +09:00
Radomir Dopieralski 0eca7449cc Fix Flake8 style warnings in openstack_dashboard/
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
2014-07-30 14:13:24 +02:00
He Yongli e790ac070e Remove extraneous vim configuration comments
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
2014-05-06 15:30:10 +08:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
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
2014-01-07 12:26:35 +01:00
Kevin Benton bb248e1d54 Adds router rules support to router details
Adds a table display and grid display for router
rules on the router details page. Changes router
details page to tab style page.

Implements: blueprint horizon-routerrules

Change-Id: I86d81db31f09e2a8d3b66a327fb9c1fb055e9d94
2013-10-16 22:39:13 -07:00
lawrancejing d33f294ba9 Remove unused LOG
In some files, we import logging and define
LOG, but we never used it later, so i remove
those unused LOG and make horizon code clean.

Fixed: bug #1231761

Change-Id: I1ebf0098c647e7522f5f1a93cfece7a52bdc05c1
2013-09-28 23:57:13 -07:00
Tatiana Mazur 953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Kieran Spear 242c8df495 Enable H201: do not write "except:"
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
2013-08-13 17:21:32 +10:00
Tatiana Mazur 3087c3486b Enable H304 check
This patch replaces relative imports with full paths and
makes H304 test enabled.

Fixes bug 1188535

Change-Id: I47254cf9a790727102f7993d0fd107da514983df
2013-07-16 18:49:56 +04:00
Mark McClain 84e054b200 update Quantum references to Neutron
implements bug: 1197208

Change-Id: I14de163ca3cf498f5cb738a4c09088bba1759488
2013-07-09 17:51:54 -04:00
Akihiro MOTOKI 8ac3e38c57 Remove router actions from Admin panel
add-interface/set-gateway/create-router actions in Admin Router panel
are no longer needed since all of these operations now can be done by
regular users. Moreover, there is a bug that admin cannot add an
interface of other tenant to a router in Admin Router panel and the
behavior is confusing for users.

Consindering the above, this commit remove forms create/modifying
quantum routers. After the commit admin router panel just provides
the list of routers of all tenants and removes them.

Fixes bug #1153754

Change-Id: Ie17601b260fc6584ba21cd19dc9492bf16b267c1
2013-03-12 05:33:08 +09:00
Akihiro MOTOKI c97e693a9d Allow non-admin users to clear router gateway properly
Fixes bug 1131193

In Grizzly-3 milestone, quantum made a change to allow regular users
to set non-owned external network as router gateway, but Quantum
router support cannot handle it, particularily non-admin user cannot
clear router gateway. This means non-admin cannot delete a router as
a result. In addition, there is no way for non-admin users to check
if router gateway is set or not since a non-admin user cannot see
a router gateway.

To address the above issues, this commit does the following changes:
- Display "external gateway info" in router table and detail to allow
  non-admin users to check if a router is connected to an external
  network (i.e., a router has a default gateway).
- Move "Set/Clear Gateway" button to router table and Set/Clear
  button is displayed based on an existence of router gateway.
- Move "Set/Clear Gateway" button in Admin panel in the same way
  to keep consistency with Project panel.

Change-Id: Ib096d5e40c88b8a605ad8aae26d1f5cf7fd745e6
2013-03-06 17:12:17 +09:00
Nachi Ueno eed092a5bb Support Quantum L3 function
Implements bp quantum-l3-support
Implemented basic CRD for router
Add/remove interface support
Support set gateway and clear gateway

Change-Id: Ie4cac962eb8fadc021c80cf05e2aa63caab3c00a
2013-01-07 20:24:57 -08:00