Commit Graph

20 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 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
Jenkins 32e72a13b2 Merge "Add Curvature topology" 2015-09-17 12:04:10 +00:00
chenqiaomin c7af83f229 Fix a bug in "Add Interface" form modal
When Add Interface for a router that it's name is blank,
it cast error "This field is required" beside the router
name field. So there should display the router's name_or_id
in "Add Interface" form modal, and this is consistent with
the "Edit Router". This bug also exists in network topology
page. This patch fix the bug.

Change-Id: I0471f76b05eba9f546916cc6fe50134c88136098
Closes-Bug: #1493725
2015-09-12 00:56:04 +00:00
Bradley Jones e0ac95be33 Add Curvature topology
Replace the current network topology with the visualisation from the Curvature
user interface

Implements: blueprint curvature-network-topology

Change-Id: I4435ab9b54ce51540c3346aa709f0fa8bbcb87b4
2015-09-11 16:35:22 +01:00
chenqiaomin 59752b6456 Fix a bug for "Set Gateway" form modal
When set gateway for a router having no name, it cast error:
"This field is required" for the router name. So there
should display the router's name_or_id in "Set Gateway"
form modal, and this is consistent with the "Edit Router".

Change-Id: Ibfcbf90f20c2eeb8b5533f8f41d4efc68df3ffbb
Closes-Bug: #1492667
2015-09-08 02:03:31 +00:00
Sam Betts 3d71d4bead Reduce title duplication in project networking
Patch https://review.openstack.org/#/c/142802 adds a method of
reducing duplication of page title logic, this patch applies that change
to the project network topology, networks and routers views.

Change-Id: I2a1372eb9d82acb3d9a259e19a3ecfb8aeff4c02
Partial-Bug: 1413749
2015-02-17 10:01:37 +00: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
Radomir Dopieralski b7537a8b81 Use memoized_method decorator in views
A lot of horizon's views use the pattern:

    def get_data(self):
        if not hasattr(self, "_data"):
            # Calculate data here.
            self._data = data
        return self._data

This is copy-pasted all over the codebase. It's better to handle that
with a single decorator. In the future, we might even replace it with
some better caching approach.

Closes-bug: #1248230
Change-Id: Id021fccf9032e5068993ec91a7774a5d0fbf29bb
2013-12-18 16:46:30 +01:00
Radomir Dopieralski 0e31e990ae Add the missing _
The error messages use the _() gettext function, which wasn't imported.

Change-Id: If515e405dcc895073643681a5e822f12ba9b9ef7
2013-10-28 11:30:19 +01: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
Matthias Runge cea720e793 Sort imports alphabetically
This patch also re-organizes imports to import one per line.

Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
2013-06-14 12:05:55 +02: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