Added pagination support to the networks page under
Project and Admin Dashboard.
To accomplish so, the method network_list_for_tenant
in api/neutron.py that is used for listing networks under
the Project Dashboard was refactored to merge the different
requests for shared, non-shared and external networks while
tracking the pagination for each of those requests, so for
instance when all the shared networks are listed and paginated
then the non-shared networks are queried and so on.
For the Admin dashboard all network types are retrieved under
a single request so it is a simpler pagination logic.
Partial-Bug: #1746184
Change-Id: I96a2d6cabed47c89bdc02ec922d7f9451e5ec025
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I2de669d8e89b8daeb7ee5405ffab35af6307c40b
We don't support Python 2 anymore so we don't need this
compatibility library.
six.reraise usages are left as is until it'll be moved to some
base lib like oslo.utils to not re-implenent this method in
Horizon.
This patch also removes Python2-specific base test case methods
assertItemsEqual and assertNotRegexpMatches in flavor of new
Python 3 analogues.
Change-Id: I26a59176be9e9f213128e4945a58b9459334b626
We don't support Python 2 anymore so we don't need this
compatibility library.
six.reraise usages are left as is until it'll be moved to some
base lib like oslo.utils to not re-implenent this method in
Horizon.
This patch also removes Python2-specific base test case methods
assertItemsEqual and assertNotRegexpMatches in flavor of new
Python 3 analogues.
Change-Id: I0b567382edf4d68674a7b8d0b02333fb57293958
This change fixes the form validation error while adding
IPv6 static routes to a router through the OpenStack Dashboard.
Unit tests to cover this action have also been added.
Change-Id: Ied0fd27dbbc33a98617c049977539c5b3c71cdfe
Closes-Bug: #1523341
- Add use_mox = True to tests which still depend on mox
- Remove use_mox = False from all tests converted into mock
- Update the warning messages
- Replace 'S'-release with 'Stein'
Part of blueprint mock-framework-in-unit-tests
Change-Id: I208185e97b2de346304a09643a9cb3f1425a7683
Signed-off-by: Akihiro Motoki <amotoki@gmail.com>
Recent pep8 upgrade and corresponding pycodestyle update break
horizon pep8 job due to the new rules.
This commit fixes the following new errors:
- E226 missing whitespace around arithmetic operator
- E241 multiple spaces after ','
- E731 do not assign a lambda expression, use a def
The following errors are added to the ignore list
as there are many errors:
- E402 module level import not at top of file
- W503 line break before binary operator
Change-Id: I3478b0684175d2604bbcc1d89cbfca298b97f1e1
After Django 2.0 support, we no longer supports Django 1.10 or older
(Actually Django 1.10 seems to work though).
The current django.VERSION branches are all related to Django 1.10
or older, so we can drop all conditions.
py35dj20 job is now voting.
blueprint django2-support
Change-Id: Iefc0ab1c62c82f2842ec7761a9b981da9351cbd2
(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
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
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
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
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
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
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
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
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.
After this, there are only 3 noqa under openstack_dashboard/ :)
Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
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
Required modifying our URL pattern decorator to
be compatible with the slightly different callback
attribute mechanism in 1.10
Modified breadcrumb structures to always be 2-tuples
as tuple unpacking is now strictly enforced in 1.10
Also made the following things changed in Django 1.10.
- fixed the now-deprecated TEMPLATE_DEBUG.
- Caught up with Request context change
- SimpleTestCase.urls is removed in 1.10.
ROOT_URLCONF needs to be used instead.
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Co-Authored-By: Akihiro Motoki <motoki@da.jp.nec.com>
Change-Id: I59cbd8bff117813258539ed0724fe89a9f5b77ee
Implements: blueprint dj110
Router rules is a horizon extension provided by Big Switch Networks.
As part of the horizon-vendor-split work, we drop the extension from
upstream horizon.
It is now available as a separate plugin at
https://github.com/bigswitch/horizon-bsn
Change-Id: I439f6f87057547f9bc0fbb7089d37b4e9603b1c1
Partially-implements: blueprint horizon-vendor-split
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
Once upon a time, the python-*client libraries were primarily built to
use httplib2. They have subsequently shift to using requests and thus
urllib3. The horizon test helpers code was maintaining a reference to
httplib2 as it intercepted errant library calls that were not mocked.
httplib2 is not actively maintained and OpenStack is moving to remove it
as a dependency. See
http://lists.openstack.org/pipermail/openstack-dev/2016-March/089225.html
for more details.
This patch removed the httplib2 dependency. Upon removing the
dependency it exposed a missed update from httplib2 to urllib3. A
function that was intended to catch unmocked calls was only listening
for httplib2 connections. This patch updates that failsafe to work with
urllib3. Upon doing so, it pointed out many, many missing mocks and in
turn, many broken tests that appeared to work because of API call
failures. This patch adds the missing mocks and fixes the broken tests.
The new failsafe prints the stack trace when an outside connection is
attempted. Additionally, to fix the fact that a missed mock used to
allow tests to potentially pass, as documented by bug 1517704, a test
failure is now forced on tests where a missing mock is detected.
Closes-Bug: #1517704
Implements blueprint: remove-httplib2-dep
Change-Id: Iaabdf03966c14c82e0c58a3b1ab1a6755c05adcb
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
With this change, all Horizon unit tests pass on Python 3.4.
Changes:
* vpn/tests.py, firewalls/tests.py: Replace reverse_lazy() with
reverse() to get a regular Python string. The lazy object caused
failures on Python 3.
* routers/tests.py: Decode HTTP body to get Unicode on Python 3. It
works also on Python 2.
* neutron.py: replace a/b with a//b to get an integer on Python 3.
* network_tests.py: remove useless copy.deepcopy() which caused a
recursion error on Python 3.
* metadata_defs/tests.py: expect a different JSON error message on
Python 3.
* tox.ini: remove openstack_dashboard whitelist, all unit tests now
pass on Python 3 ;-)
Partial-Implements: blueprint porting-python3
Change-Id: I7b4f036fc86b66c92cccafe6938a906045f03186
Some tests check for equality with quite large HTML fragments, when
the test is only interested in certain specific things (and not style
changes etc). This patch alters some of those tests (specifically ones
that were tripping up a dependent patch, but can be expanded) to check
the context data of the response, since the actual rendering is tested
by horizon's tests.
It also adds tests to check context data in 'normal' circumstances so
that no test coverage should be lost by this.
Change-Id: I09be82058edc923521ffb4c022515845a18b158d
Closes-Bug: #1517084
This patch adds basic Breadcrumb nav to the detail pages for Data
Processing, Databases, Metadata Definitions and Routers.
Change-Id: I114e93799b957db39cbe0d4e49d3e6869bc9d92d
Partial-Bug: 1413823
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
netaddr 0.7.16 changed the behavior of IPNetworks with /31 and /32
prefixes to make their 'broadcast' attribute return None. This patch
replaces the use of the attribute with a -1 index lookup to get the
last address instead.
Revert Ida700555c133e27da2c76357986adfc8193fe89b and re-enables the
test_routerrule_detail test.
Change-Id: I0887b0112f97b537e4c1467c47ab78b1f94f238b
Closes-Bug: 1490403
Closes-Bug: 1490423
mox doesn't work on Python 3, whereas mox3 works on Python 2 and Python
3. Cinder, Nova and many other projects already replaced mox with mox3.
mox3 is now maintained by OpenStack.
Partial-Implements: blueprint porting-python3
Change-Id: I10e6a9754ebd58a2640d73ec8966527c3aa1fe9a
When we already add the subnet to router,
if we click 'Add Interface' again, we can see
the subnet also can select, but if we real to
add the subnet, it report a error. We can hidden
the subnet if it already add to the router.
Closes-bug:#1417892
Change-Id: I485608d267b9b235c1e83a990e330dd1ca98f17e
This patch addresses the stylistic inconsistencies in the Router details
pages, by changing it into a tabbed detail page
- Fixed bug on the Interfaces table causing the Name field to be empty
- Overview page has also been restyled to more clearly show information
and link to relevant network
- Increased inheritance where possible, to reduce duplicate code
- Deleted unused files/functions. These can always be added as required
later, but there is no need for unnecessary code bloat
Co-Authored-By: Sam Betts <sam@code-smash.net>
Change-Id: Ifbdfbf46127e9445395207c547c2b81ea9459dac
Closes-Bug: 1378895
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
There are still some scss mixins that use the old (from bootstrap 2)
image icons. Replacing them will have to be done in a separate patch.
I also link to the css file, instead of scss, because django-pyscss has
some problems finding the right file. This is reported and will have to
be fixed upstream to unbundle bootstrap.
Change-Id: I67e94a9283bcceef8fc89343f3f5b2d7e0d4449f
Partial-implement: blueprint font-icons-replace
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