Commit Graph

50 Commits

Author SHA1 Message Date
Janet Yu
e2ef492311 Fix addition of plugin panel to panel group
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
2015-04-22 23:02:43 -07:00
Radomir Dopieralski
8697a93d18 Use novaclient v2 instead v1_1
Because v1_1 is deprecated.

Closes-bug: #1435201
Change-Id: I12a8c961d90bc79cc44b7c7f4e1a4bdbfa55f6a2
2015-03-23 09:45:42 +01:00
Mike Hagedorn
255340c596 REST API to support create instance angular (Neutron).
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/152243
https://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
2015-03-04 07:20:43 -05:00
Richard Jones
243d2a5a44 Refactor REST API tests for common code patterns
Move common patterns out into a helper class and refactor
tests to use that base helper.

Change-Id: Icd2512da3902d8dcf6d28af3d09fc4ee0bf1f33a
2015-02-26 02:55:53 +00:00
Travis Tripp
c7a3e891fe Network Rest API for Angular Front End
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>
2015-02-20 16:40:36 -07:00
Radomir Dopieralski
e0168e773a Make test helpers properly inheritable/extendable
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
2015-02-04 10:48:32 +01:00
David Lyle
48093c7a4c Documenting create_stubs decorator for tests
Closes-Bug: #1398912
Change-Id: I0ae1cb2da9693f5d2904cd96d475519b753a589d
2014-12-12 10:44:49 -07:00
Ladislav Smola
01f5d1e718 Stack update call needs password
Stack update call needs password otherwise it fails.
Added missing tests.

Change-Id: I99b0ce460c772862b22fa0216466589893948178
Closes-bug: #1394505
2014-11-25 15:04:51 +01:00
Radomir Dopieralski
dece4cc345 Move the panel mocks to a separate method on TestCase
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
2014-10-24 11:18:20 +02:00
Jenkins
6cf2b0658d Merge "Hide the "Host Aggregates" admin panel if not enabled" 2014-10-22 17:05:38 +00:00
Vlad Okhrimenko
4556bc8086 Hide the "Host Aggregates" admin panel if not enabled
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
2014-10-22 16:20:09 +03:00
Akihiro Motoki
26da6ed48c Fix E127 errors in remaining openstack_dashboard/
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
2014-10-15 13:50:07 +09:00
Chuck Short
456c69e0b3 swift: Respect the OPENSTACK_SSL_NO_VERIFY setting
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>
2014-09-16 10:38:21 +01:00
Michal Dulko
d5fea888a8 Enable flavors metadata update
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
2014-09-15 16:48:06 +02:00
Jenkins
8e11b803f6 Merge "Display Network panels based on neutron ext-list" 2014-09-02 09:32:24 +00:00
Akihiro Motoki
9ea081ef6c Display Network panels based on neutron ext-list
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
2014-09-02 03:48:32 +09:00
lin-hua-cheng
7a7a1d1c61 Domain Role assignment to Users
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
2014-08-22 23:56:40 -07: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
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
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
lin-hua-cheng
e1080cbe05 Plugin-based panel group configuration
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
2014-03-29 01:05:03 +09:00
Ana Malagon
29f9fc75d0 Updated outdated docstring, fixed typo/space
Change-Id: Ie0770eb4c9c3dd859d393f4005cb1b63bd9176c2
Closes-Bug: #1288887
2014-03-10 12:38:58 -04:00
David Lyle
043085f812 Fixing tests to work with keystoneclient 0.6.0
Another item needs mocking with the new release of
python_keystoneclient. Adding it to mocked keystoneclient.Client
object.

Closes-Bug: #1279907
Change-Id: I3c43a7290a6e05c718082dcad369162bf21e3603
2014-02-13 14:01:12 -07:00
David Lyle
f7d00b5960 Adding management_url to test mock client
Mocking management_url property in keystoneclient.Client for mox.

Change-Id: I53dbb9357808584007b2871d4804150e2c547436
Closes-Bug: #1268631
2014-01-13 08:57:00 -07: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
Ana Krivokapic
0f2e30e0ff Extend options for custom flavor sorting when launching instances
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
2013-12-11 13:43:09 +01:00
Robert Myers
8bca2eb363 Update troveclient to 1.0.0
Closes-Bug: #1238121

Author: Robert Myers <robert.myers@rackspace.com>

Change-Id: I03d3d95602f4009c97d37fdf8e241ec8ab82389d
2013-11-25 08:25:32 -08:00
Paul Belanger
da8c69afa6 Gate on H4xx docstrings for pep8
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>
2013-11-23 12:51:07 -05:00
Ana Krivokapic
084733b137 Fix "it's vs. its" typos
Change-Id: Ib7914a7c0b6636599526d05bfb8bc2bcf3a79744
Closes-Bug: #1252838
2013-11-19 20:38:21 +01:00
Steve Leon
0f9617cb55 Importing from trove-client compat first
- Switched the logic so that the compat version is imported first

Fixes bug #1250237

Change-Id: I7650fc6c3ce93164ca8bee610d5fe2293df3ecc7
2013-11-14 15:44:18 -08:00
Steve Leon
2fc1a45a84 Importing from trove-client compat
Fixes bug #1250237

Change-Id: I7a67fa7e2ab34c960fed908090edb05059ae74e4
2013-11-11 16:59:42 -08:00
Russell Sim
fa3a039d05 Ignore irrelevant secgroup form field errors
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
2013-10-13 14:46:09 +11:00
Matthias Runge
c9022fa065 Make troveclient optional
Fixes bug 1221906

Change-Id: I3d022fca2f6bc1f0f5143373259882f2522f7958
2013-09-17 10:18:49 +02:00
simon
ec727ac394 PEP8 E121 has been resolved
Change-Id: I6ad2704100447c5a3be12c2ebeec824726e3bd0b
Partial-Bug: #1085346
2013-09-05 14:38:58 +08:00
Jasper Capel
12ab09a994 Custom CA certificate for verifying SSL connections
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
2013-09-03 11:24:41 +02: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
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
Tatiana Mazur
b4fc9b4bc9 Small "H302 check" cleanup
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
2013-08-23 18:07:08 +04: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
Julie Pichon
589092c5f2 Ensure the user monkey patching is done for the API tests
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
2013-08-07 16:40:02 +01:00
David Lyle
87084f7af8 Adding the ability to set/use domain context
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
2013-07-10 09:00:09 -06:00
Mark McClain
84e054b200 update Quantum references to Neutron
implements bug: 1197208

Change-Id: I14de163ca3cf498f5cb738a4c09088bba1759488
2013-07-09 17:51:54 -04:00
Sascha Peilicke
2a6d669443 Mock some more keystoneclient.Client properties for mox
Fixes LP bug 1196823

Change-Id: I9b0c56eda95ee83cf56a28f2f1b7316ad2592fa2
2013-07-02 09:22:27 +02:00
Sascha Peilicke
82bdecb117 Manually mock service_catalog in stub_keystoneclient
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
2013-06-17 15:28:48 +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
Steve Baker
53d2d9352b Preparing for Heat tests
Required for blueprint: heat-ui

Change-Id: Ibac4ab7d238ab946a096767218faf9e222699cb6
2013-05-22 16:11:30 +12:00
Sascha Peilicke
1e86770041 Correctly mock keystoneclient.Client.auto_token property with Mox
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
2013-02-26 16:03:13 +01:00
Matthias Runge
24367e6cea Avoid cinder calls, when cinder is unavailable
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
2012-12-12 09:59:01 +01:00
Julie Pichon
ffb98f19e6 Client-side validation of password/confirmation match
Fixes bug 1055234

Change-Id: I25a3e8463894f0fb08e26e502f1baf0822d90437
2012-11-20 15:42:02 +00:00
Gabriel Hurley
cb8e7c1f8f Splits OpenStack Dashboard bits from framework app code.
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
2012-10-11 11:47:50 -07:00