Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
class. Adding a plugin panel to a dashboard whose class has its panels defined
in a tuple will fail because the new plugin cannot be appended to the tuple.
The code errors out before the panel gets added to the dashboard's panel list.
However, at this point, the panel has already been registered with the
dashboard. This causes Dashboard.get_panels() to see the panel in its registry
but not in its panel groups. Consequently, the panel gets put in the "Other"
panel group instead of its configured one, as described in bug #1378558.
By not adding the the plugin panel to its dashboard's class, the panel gets
added to its dashboard's panel list. Now the original issue from bug #1329050
resurfaces. The root cause of that is that every time Dashboard._autodiscover()
is called, it instantiates all its panel group classes, wiping out any panels
previously added to any of the panel groups. Avoid this by always processing
all the plugin panel groups before any of the plugin panels, which also ensures
that the panel groups exist before their panels.
Making this change exposed an issue where the Horizon URLs were being loaded
twice during the plugin infrastructure's unit tests, causing plugin panels to
be added multiple times to their dashboards. Fix that by removing the second,
unnecessary call. Also create a second test plugin panel group and panel to
test the scenarios described in the two bugs addressed here, adding two panel
groups at a time.
Change-Id: Id6a99c3ff18102c8f47431638d4dda98f14ec641
Closes-Bug: 1378558
In this update:
- fixed tests
- fixed exception handling, params on ports
- fixed to_dict for a number of cases
- replaced use of request.DATA with request.GET for GET methods
- added handling of HTTP error raised with no status/code attr
- removed check for network_id in subnets as it's not required
- fix to_dict for Network with Subnets
Supercedes
https://review.openstack.org/#/c/152243https://review.openstack.org/#/c/151313
Partially Implements: blueprint launch-instance-redesign
Co-Authored-By: Aaron Sahlin <asahlin@us.ibm.com>
Co-Authored-By: Michael Hagedorn <mike.hagedorn@hp.com>
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Change-Id: Ia40fde6d66720a03a531b516a6a53a2e86ec0d8f
This is the API which abstracts Nova vs Neutron calls
for the angular front end.
This initial patch will only implement the APIs needed to
support the launch instance work.
Partially Implements: blueprint launch-instance-redesign
Change-Id: I6967fbae472e6aa944994d94ab327c4fb594b1d0
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
The helpers.TestCase classes didn't call their superclass' methods
in their setUp and tearDown methods, which made it impossible to
probperly inherit from them and use mixins with them.
I split the code that was differing for them into separate methods,
removed common code and made them use super() correctly.
Due to some inspect magic, the factory creation has to be duplicated.
Change-Id: I0bf909b1e4324c1e36bcdb83daece391bd0cfae7
We need to remove the panel mocks in Tuskar-UI tests, because they
import and register the admin panel as their side effect. To do that
easily, I'm moving that part into a separate method.
Partial-bug: #1384683
Change-Id: Ica366c0b9f680049a74e94007a563ffdb492e4f4
This checks ether the extension is supported in nova and disables
access to the panel (hiding it) if not.
Closes-Bug: #1332066
Change-Id: Ie6f5ec7a833d489adca6d56f34a39579e9eabdde
E127 continuation line over-indented for visual indent
Also fixes E127 introduces by other reviews
after other E127 fixes were merged.
Closes-Bug: #1375931
Change-Id: I0a09f1c2f74c707fc8a347f0ea5975bf2679976e
The swift API client connection does not respect the
OPENSTACK_SSL_NO_VERIFY setting in the local_settings.py.
As a result a SSL verfication error happens with a
self-signed certificate.
Closes-Bug: #1311357.
Change-Id: I907a8f7c5c631adfaf2ca66385749bb8e86734f2
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Nova currently expose an api to let the users update
the flavors metadata so horizon should expose
this functionality. At the same time Glance is exposing
a metadata dictionary in Juno, where users can register
the key/value pairs that describe their cloud deployment.
This patch uses the glance metadata api to expose the available
metadata and the nova api to update the aggregates metadata.
Implements: blueprint glaance-metadata-flavors
Co-Authored-By: Santiago Baldassin <santiago.b.baldassin@intel.com>
Co-Authored-By: Pawel Skowron <pawel.skowron@intel.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
DocImpact:
New UI. FLAVOR_EXTRA_KEYS setting deprecated.
Change-Id: Ica9d3d06314a4d5afa77f644bd1f8900a1c328f7
Neutron features like LBaaS, FWaaS or VPNaaS are provided as
extensions in Neutron. This commit changes these features are enabled
only when they are included in the extension list from Neutron.
It also change the default settings of enable_lb/firewall/vpn to True.
The default of these settings were set to False to avoid confusion to
users because LB/FW/VPNaaS are optional features in Neutron. By this
commit corresponding features in Horizon are enabled dynamically, so
it is reasonable to change the default to True.
This commit introduces Horizon version of override_settings
"update_settings" decorator which allows override an item in dict.
Django original override_settings replaces a dict completely,
however OpenStack dashboard setting has many dictionary configuration
and there are test case where we want to override only one item
in a dictionary and keep other items in the dictionary.
This version of override_settings allows this.
DocImpact
Implements blueprint neutron-feature-control-with-ext-list
Change-Id: I19424d448c800524de0ee8ac769974272dbb84a0
Added Domain User step in the Domain Update workflow for managing
domain-role assignment to User.
Change-Id: I629449c635319e3a4292a4e2be35c5d9fc8a7cf9
Implements: blueprint user-domain-role-assignment
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
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>
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
Panels can be added through plugin configuration, but it is broken
if the user can only use existing panel groups. This adds the
capability to create an empty panel group that can be used by panel
configuration to add itself to the group.
Change-Id: I28d6072fc05b3a4ef5a41cd68337a7864c560525
Closes-Bug: #1287981
Another item needs mocking with the new release of
python_keystoneclient. Adding it to mocked keystoneclient.Client
object.
Closes-Bug: #1279907
Change-Id: I3c43a7290a6e05c718082dcad369162bf21e3603
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
Until now, flavors were sorted by RAM, ascending, by default.
An option to override this and use a custom callable instead
was introduced via the CREATE_INSTANCE_FLAVOR_SORT dict in
local_settings.py.
This patch introduces another way of using the
CREATE_INSTANCE_FLAVOR_SORT dict: by providing a flavor attribute.
Change-Id: I5b2819cc3ebc97377e673682d0b2c7ddab94e3d3
Closes-Bug: #1254524
In an effort to help horizon more friendly to OpenStack hacking
guidelines, we now gate on H40* violations.
Change-Id: Id07294543660368d2f7f5ac363710176ab23b874
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
When cleaning data from in the security group rule form, remove any
associated error messages that are not related to the actual fields
being saved. If we are setting a value derived from another field, also
delete the error message associated with that field.
Change-Id: I1eb4835ea2368b62374f230c6293062a2340980d
Closes-Bug:1237128
The various OpenStack client libaries support specifying a SSL
certificate that should be used to verify the SSL-connection, but
this option was not exposed in the horizon options. This patch
implements that. Note that although some clients do implement a
cacert-parameter, they do not necessarily actually verify the
certificate (Swift).
Change-Id: I9dfbd48a0d96103421da7d884e839d591a90cab1
Implements: blueprint ssl-cacert
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
This patch set removes some commented out stuff that
has been unintentially left in "H302 check" patch set.
It also replaces a couple more method imports with
module imports.
Fixes bug 1215892
Change-Id: I35fd880154a4ea6d6d8d3b3615103c271aa4a005
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
When running a subset of the tests, the get_user middleware monkey
patching in openstack_auth.utils did not always happen, causing some
of the tests to fail due to missing expected properties.
Fixes bug #1209177
Change-Id: Ic00b842e740954b0f36353381f511f7ba3eab70b
Setting the domain context allows admins to view the identity
resources (projects, users, groups) for a particular domain.
The context can be set or cleared. The default is no domain
context set. If no context set, the current behavior of listing
all resources across domains is maintained.
Additionally, the identity panels have been grouped in a new
PanelGroup called Identity Panel to logically separate this
functionality from other service related panels.
Implements: blueprint domain-context
Change-Id: I5dd6279129824971968c20fd30919b109bf6b00a
MockObject.__init__ ignores properties, fixes:
FAIL: test_get_default_role (openstack_dashboard.test.api_tests.keystone_tests.RoleAPITests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/lib/openstack-dashboard-test/openstack_dashboard/test/api_tests/keystone_tests.py", line 78, in test_get_default_role
keystoneclient = self.stub_keystoneclient()
File "/var/lib/openstack-dashboard-test/openstack_dashboard/test/helpers.py", line 287, in stub_keystoneclient
self.keystoneclient = self.mox.CreateMock(keystone_client.Client)
File "/usr/lib64/python2.6/site-packages/mox.py", line 258, in CreateMock
new_mock = MockObject(class_to_mock, attrs=attrs)
File "/usr/lib64/python2.6/site-packages/mox.py", line 556, in __init__
attr = getattr(class_to_mock, method)
File "/usr/lib64/python2.6/site-packages/mox.py", line 608, in __getattr__
raise UnknownMethodCallError(name)
UnknownMethodCallError: Method called is not a member of the object: service_catalog
>> raise UnknownMethodCallError('service_catalog')
Change-Id: I0af2f571855ad63c204e26d8283a713be0caae8f
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
Recent Mox doesn't stub out class properties any more (check
https://code.google.com/p/pymox/issues/detail?id=11), so we have to do
that manually. Avoids the following error:
FAIL: test_get_default_role
(openstack_dashboard.test.api_tests.keystone_tests.RoleAPITests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/Projects/openstack/horizon/openstack_dashboard/test/api_tests/keystone_tests.py", line 76, in test_get_default_role
keystoneclient = self.stub_keystoneclient()
File "/root/Projects/openstack/horizon/openstack_dashboard/test/helpers.py", line 280, in stub_keystoneclient
self.keystoneclient = self.mox.CreateMock(keystone_client.Client)
File "/usr/lib/python2.7/site-packages/mox.py", line 258, in CreateMock
new_mock = MockObject(class_to_mock, attrs=attrs)
File "/usr/lib/python2.7/site-packages/mox.py", line 556, in __init__
attr = getattr(class_to_mock, method)
File "/usr/lib/python2.7/site-packages/mox.py", line 608, in __getattr__
raise UnknownMethodCallError(name)
UnknownMethodCallError: Method called is not a member of the object: Method called is not a member of the object: auth_token
>> raise UnknownMethodCallError('auth_token')
Change-Id: I54fd0de298dc66344470147d9bcec6b62baf8297
When a volume service is not available, then a cinder client can not
be created. This patch skips the calls, so that dashboard doesn't
break any more.
Change-Id: Ic5d029302d10b453257b452ba78541febf8e4c96
Fixes bug 1084137
Moves everything OpenStack-specific (dashboards, apis, etc.)
into the openstack_dashboard project, achieving a much
cleaner separation between the project-specific code and
the generic Horizon framework code.
Change-Id: I7235b41d449b26c980668fc3eb4360b24508717b