Commit Graph

46 Commits

Author SHA1 Message Date
Thomas Goirand 8770753fcc Specify transform=repr in assertQuerysetEqual()
Previously "repr" was automatically applied to "qs" argument of
assertQuerysetEqual() and most horizon unittest behaviors assume it.
It was deprecated in Django 3.2 and removed in Django 4.1. We need to
specify transform=repr explicitly to use the existing behavior.

[1] https://docs.djangoproject.com/en/3.2/topics/testing/tools/#django.test.TransactionTestCase.assertQuerysetEqual

Closes-Bug: #2038474
Change-Id: Ie7c7e9a1efc492889639e25509c8e614268c1d26
2023-10-23 14:24:49 +09:00
Ivan Kolodyazhny 14e779bbac Use unittest.mock instead of third party mock
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
2020-03-26 19:45:37 +02:00
Vladislav Kuzmin 324dce500e Convert admin.info tests into mock
Partially-Implements: blueprint mock-framework-in-unit-tests
Change-Id: If5bc1e2e6471e0d4cf8adfbe6bc82103cafda158
2018-03-18 17:15:47 +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
Akihiro Motoki eac3e7032a Drop Heat related code from horizon
Orchestration tab in the admin info panel needs a discussion.
It seems not to be covered by heat-dashboard yet.

blueprint heat-dashboard-split-out

Change-Id: I56e6edb1f2ac72e2f42d0e9f3291308e67f24cad
2017-12-05 07:38:55 +00:00
Trygve Vea 887d7fb847 Add network availability zone information for network agents
This patch adds the availability zone column for network agents on the system
information page, if either the router_availability_zone or the
network_availability_zone extension is enabled.

Change-Id: Id7509fab440383bff45cb8ce5bdc3f8eb62045f4
Closes-Bug: #1716638
2017-10-21 09:10:34 +00:00
Akihiro Motoki baa4ca8dce hacking: noqa cleanup in openstack_dashboard
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
2017-03-17 19:38:47 +00:00
Bin Zhou 9afd7d0875 Modify use of assertTrue(A in B)
Developers should use assertIn(A, B) instead of assertTrue(A in B ).

TrivialFix

Change-Id: I93f3c540e4cc9015162283ea71813613a13e3555
2016-09-03 11:26:52 +08:00
eric 5934d83b04 Improve system info page
This change adds region info and all the url types,
and also removes enabled (which never did anything).

Change-Id: I7594d2b3d1e9826ec66bac379059171150155c4b
Closes-bug: #1497448
2016-05-26 15:52:38 +00:00
IWAMOTO Toshihiro 2e59431227 Look for volumev2 endpoints instead of volume
Volumes tabs should be enabled when volumev2 endpoint is registered.
Currently, Horizon considers no volume service is running if there
is no V1 endpoint, which doesn't make sense as Horizon no longer
supports the cinder V1 protocol.

Co-Authored-By: itxaka <itxaka@redhat.com>
Change-Id: I35d821eedb75f73f9330ed11f921694104eed0c6
Closes-Bug: 1415712
2016-02-23 11:47:25 +01:00
David Lyle 9a58663fae Excise Trove from Horizon
With the merging of https://review.openstack.org/256605/
https://git.openstack.org/openstack/trove-dashboard exists and
contains the content previously integrated in the Horizon
repository.

Change-Id: Ic742f054f629a6fa078cf1e6eb137f5f8da7089d
2015-12-22 02:01:07 -07:00
David Lyle 4fbe4af80e Excising Sahara from Horizon
The content is proposed to the openstack/sahara-dashboard repo.

Change-Id: Ie76b09b9bdbdb975c1cd39658f02bcf95b98b961
2015-12-03 22:52:23 +03:00
Victor Stinner 674a45ffe0 Replace mox with mox3
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
2015-07-13 15:02:10 +02:00
Chad Roberts f4781d8796 Fixing permissions for data processing panels
Recently, the data processing service was renamed to
"data-processing" rather than "data_processing".  Each
panel needs to be updated so that it will show up when
the data-processing service is enabled.  Also updated
the underlying test data to reflect the update.

Change-Id: I38d7350215cbe5c5f406d75d6be7c9057957bc69
Closes-Bug:  #1429987
2015-03-09 17:17:22 -04:00
Gary W. Smith dca7117fdf Permit using latest python-cinderclient
Fix a number of unit tests so that they will work with the latest
cinderclient, which will be released by the end of Kilo.

The problem was that several horizon unit tests made calls into
python-cinderclient that should have been stubbed out (but were not).
These calls silently did nothing in the released python-cinderclient due
to a "feature" where certain GET functions would return an empty list
when the auth url was an empty string, instead of returning an auth
failure.  Recent changes in the python-cinderclient authorization
functions closed this hole, which then revealed problems in the horizon
unit tests:
1) several tests were lacking stubs to cinder calls, and
2) the auth url in test of cinderclient v2 was empty due to a missing
   dictionary entry in test_data/keystone_data.py

Change-Id: I33967a924f4e47009fdc1613248afd1bd377f34f
Closes-Bug: 1423425
Co-Authored-By: Richard Hagarty <richard.hagarty@hp.com>
2015-03-03 15:45:52 -08:00
Kanagaraj Manickam d34fe26cf8 Add orchestration service status reporting
System Information panel is updated with new tab called
Orchestration Services to report the heat engines status.

Implements blueprint heat-engine-status-report

Change-Id: Ibb6985c74dfb0b23a5ef94febde127a673ab0e38
2015-02-25 00:23:36 +05:30
Sergio Cazzolato b2dd9ded59 Revert "Remove the update default quotas feature"
This reverts commit ed586a0355.

The quota_class subcommand in python-novaclient was used to set default
quota values so it shouldn't have been removed. As now it is being
restored, the defaults quota panel is being restored too.

Related mailing list thread on the topic:
http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html

Resolved merge conflicts by hand in:
openstack_dashboard/api/cinder.py
openstack_dashboard/dashboards/admin/info/tabs.py
openstack_dashboard/dashboards/admin/info/tests.py

Updated translatable segments to match refactors in
openstack_dashboard/dashboards/admin/defaults/workflows.py
openstack_dashboard/dashboards/admin/defaults/tables.py

Fixed most egregious post-merge styling errors in
openstack_dashboard/dashboards/admin/defaults/templates/defaults/index.html
(probably should have been separate, but I just couldn't let it out that way!)

Removed unrelated file that was allowed to be part of the original commit
doc/source/topics/settings.rst

Co-Authored-By: Doug Fish <drfish@us.ibm.com>
Change-Id: Ic4c4ecec843c7ea9afd0db36ce0eb15952da15b3
Partial-Bug: #1299517
2014-09-30 18:12:02 +09:00
Jenkins c3d5e1109f Merge "Implement missing mocks to remove error noise during test run" 2014-07-04 16:51:20 +00:00
Richard Jones ff6425bf20 Implement missing mocks to remove error noise during test run
Several cinder API mocks were missing from these tests. This patch
adds those so the error noise reported in bug 1329391 is removed.

Change-Id: Ib0ca72ff0df92d1c5187a86469ea7fc93873de11
Closes-Bug: 1329391
2014-07-04 14:40:22 +10:00
Chad Roberts 7c3897a4bd Adding plugins panel for Sahara
The plugins panel is used to show the various
hadoop flavors/versions that are supported by the
underlying Sahara API.
* also added basic panel tests
This code was originally from:
https://github.com/openstack/sahara-dashboard

Change-Id: Ib0c95334a5122529fddbfd9c0cd0d0c06e0c8ad3
Partial-Implements: blueprint merge-sahara-dashboard
Co-Authored-By: Nikita Konovalov <nkonovalov@mirantis.com>
Co-Authored-By: Dmitry Mescheryakov <dmescheryakov@mirantis.com>
2014-07-01 09:29:07 -04:00
Nachi Ueno 5179d99800 Check neutron agent extension support in Info page
Some neutron plugin don't support agent extension, and
Horizon show 404 error on admin info page.
In this commit, we are going to add check if agent
extension supported or not.
Closes-bug: 1331032

Change-Id: I5cd3ec747c650fc2b826d55f39be618eca1b7caa
2014-06-25 18:15:37 +00:00
Santiago Baldassin 03ed6e1ad1 Display cinder services in System Info
This change includes cinder services in the system info
panel so that users can check which are the cinder services
and their status

Implements: blueprint cinder-service-list
Co-Authored-By: Leandro Costantino <leandro.i.costantino@intel.com>
Change-Id: Ic3594621ff956ef5aa76fb6617b5339f56015248
2014-06-05 15:23:09 -03: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 e019ed140e Add missing mock for cinder.default_quota_get
When running tests, I get the following logs:

INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1):
public.nova.example.com

DEBUG:cinderclient.client:Connection refused:
HTTPConnectionPool(host='public.nova.example.com', port=8776): Max retries
exceeded with url: /v1/os-quota-sets/1/defaults (Caused by <class
'socket.gaierror'>: [Errno -2] Name or service not known)

Which signify, that there is a mock missing in the tests.
This patch adds that missing mock.

Change-Id: I4f79f533b729112d11c7165adde2ac751d49f46b
Closes-Bug: #1300141
2014-04-01 04:36:39 -04:00
Sergio Cazzolato ed586a0355 Remove the update default quotas feature
The default quota panel has been moved to a tab in the system
info panel.
The update default quotas feature has been removed.
The cinder quota-class methods have been removed to keep consistency.
The test cases and the apis for nova and cinder have been modified
according the change.

This change is done to support the change:
I1110022d6f628d03aaf363da707f2d2ef1600437

Change-Id: I193c7209d9681b6d69afe0d996153ac86850d243
Closes-Bug: #1292589
2014-03-26 12:19:21 -03:00
Facundo Farias ed1525bc91 Host aggregates panel.
On this panel, aggregates could be added, deleted and edited.
This patch takes the aggregates panel out of System Info and
puts it back in the main admin panel list, as now, aggregates
are not static information. The host can be associated to a
host aggregate on this panel as well.

Change-Id: I4ef2d87c33981db36d4ebd3de2f4841cdfa9dbfd
Closes-Bug: #1261932
Implements: blueprint manage-host-aggregates
Co-Authored-By: Santiago Baldassin <santiago.b.baldassin@intel.com>
Co-Authored-By: Alejandro Paredes <alejandro.e.paredes@intel.com>
2014-03-04 15:25:32 +00: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
Christian Berendt 240419544f added Network Agents to System Info panel
Added a new tab to the System Info panel showing all Network Agents.

fixes bug #1204375

Change-Id: I9c23105dde8528749275aba70065384dec354fb7
2013-09-03 14:03:08 +09:00
Robert Myers 8c1bc54f93 Adding panels for trove
* Add python-troveclient to requirements.
* Add trove api to openstack_dashboard apis.
* Add Database Instances panel.
* Add Database Backups panel.

Authors:
* Robert Myers
* Denis Makogon
* Andrea Giardini

Implements: Blueprint trove-support

Change-Id: I0541534612ccb491d692168c3c9ca7a841650be6
2013-08-31 23:27:46 -05:00
liyingjun 5f8e370f2d Allow admins to update default quotas
Add update default quotas form to edit the default quotas.

Move the editable default quotas tab to a new panel called
"Defaults".

Implements blueprint edit-default-quota

Change-Id: I6e3806226cd2f699f16b93c25e294bc67883738f
2013-08-29 23:18:08 +08:00
Jenkins ee9b759822 Merge "Add ceilometer api and the tests for it" 2013-08-29 01:49:00 +00:00
Ladislav Smola 69d67c08ab Add ceilometer api and the tests for it
Adding ceilometer api basic function wrappers.
Adding Class wrapper of each ceilometer object.

Adding ceilometer general usage wrappers for common statistics over
list of Resources and ResourceAggregates.

Adding specific table statistics wrappers.

Adding tests and test data for Ceilometer API.

Best to be tested with commit for resource usage panel at:
https://review.openstack.org/#/c/35590/ - this commit is for the
test purpose only.

Link to bp: https://blueprints.launchpad.net/horizon/+spec/ceilometer

Implements bp ceilometer.
Change-Id: I5b3392de8bae2be8cbcba7a580af669676e54052
2013-08-28 19:21:37 +02:00
Julie Pichon 3852d1ce19 View and update Neutron project quotas
Also ensure that the correct quota is displayed in the Floating IPs
allocation page (Security & Access panel).

Closes-Bug: #1109140

Change-Id: I30d207fbf149bfbcfefeaddf91af49082b7b1f53
2013-08-27 19:13:10 +01:00
Julie Pichon 065786c745 Import is_service_enabled from module
An additional step for H302, and needed here to make mocking
is_service_enabled across modules more consistent and easier
(e.g. mocking only one signature as opposed to both
api.base.is_service_enabled and quotas.is_service_enabled).

Partial-Bug: #1109140

Change-Id: Ie6cec3138de6f2fc57b68e90db45f53bb94ab87d
2013-08-27 19:13:10 +01: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
Gabriel Hurley c4ac732aa9 Adds availability zone info to System Info panel
Also moves the host aggregates data into System Info panel
because it's exactly the type of static information that
belongs there, and it reduces a significant amount of
boilerplate.

Incidentally adds a new table feature to make listing
out unordered lists of items easier.

Implements blueprint show-zone-for-admin

Change-Id: Id8fb5c9615b018135a5d90eaa82eb80ff63bb7dc
2013-08-19 23:13:10 -07:00
Julie Pichon 913ff38b6d Hide default Floating IPs quotas with Neutron
It is not possible to access the default quotas via an API for
Neutron. Remove the quota in that case for now, as it comes from Nova
and could cause confusion.

Partial-Bug: #1109140

Change-Id: If8df21b4ecbe541ce53790578820e22f36c32260
2013-08-14 00:01:01 +01:00
Christian Berendt 699926413c added Compute Services to System Info panel
Added a new tab to the System Info panel showing all Compute Services.

fixes bug #1198247

Change-Id: I7389652cff37a1282cff48c919ab36b645fbee88
2013-07-24 09:33:24 +02: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
Jenkins 144fda877f Merge "Enable snapshot quota setting" 2013-05-29 07:11:43 +00:00
Jan Provaznik ea1edcb027 Enable snapshot quota setting
Change-Id: Ie8bcd2d2fddf717a29328bc802a2fda80198183b
Fixes: bug #1177249
2013-05-27 14:22:38 +02:00
Steve Baker 7bf24bfa12 Orchestration endpoints for keystone test data
This is required for stacks unit tests

Change-Id: I4dd9fac3429e25534d95cedc617ee32297b446ec
2013-05-24 14:46:13 +12:00
Julie Pichon e65e3e8bc3 Refactor the quotas tests
Refactoring as part of bug 1157950 to limit the amount of copy-pasting
required when adding a new quota

Change-Id: I32fb28da0d4640c463fb6e22ee04763012d12190
2013-04-04 14:47:56 +01:00
Julie Pichon d5f2dc38e6 Allow admin to edit project quotas for fixed IPs
Fixes bug #1157950

Change-Id: If8bf548f66ff13b2b5218ca6c1e8c69c054e0a59
2013-03-26 17:58:01 +00:00
Julie Pichon 7584fe39b4 Allow admin to edit project quotas for security groups and rules
Fixes bug 1078092

Change-Id: I1018f07f740b7e27e14fb00bac4c3cce177469e2
2013-02-19 15:57:24 +00:00
Gabriel Hurley 2f98befe3f Reworks quotas and services panels into System Info panel.
This is a step towards combining all the "read only" data about
an OpenStack cloud into one place for admin inspection.

Implements blueprint system-info-panel.

Change-Id: I2dc52a855c1c8a488fb9c66b82e0faca765b3812
2012-11-17 15:49:17 -08:00