Commit Graph

17 Commits

Author SHA1 Message Date
Monty Taylor 3b2cad5d31
Decouple OpenStackCloud from Connection
Revert the openstacksdk subclassing from shade. The idea was to
reduce the workload, but trying to make sure that the Cloud abstraction
in openstacksdk doesn't break shade's contract while we update things is
a ton of work to meet the contract that's not really valuable to people.

Instead, we'll put shade on lifesupport and only accept bugfix patches.

Revert "Make OpenStackCloud a subclass of Connection"

This reverts commit ab3f400064.

Revert "Use openstack.config directly for config"

This reverts commit 2b48637b67.

Revert "Remove the task manager"

This reverts commit 28e95889a0.

Change-Id: I3f5b5fb26af2f6c0bbaade24a04c3d1f274c8cce
2018-10-16 08:58:01 -05:00
Chuck Short 8e56081226 Replace assertRaisesRegexp with assertRaisesRegex
This replaces the deprecated (in python 3.2) unittest.TestCase method
assertRaisesRegexp() with assertRaisesRegex().

Change-Id: I1f20db33e3acfc87c0e7a5c8cf45dc1b3121619e
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-08-27 09:35:38 -04:00
Monty Taylor ab3f400064
Make OpenStackCloud a subclass of Connection
The shade code lives in openstacksdk now and is a part of Connection.
Start making shade a subclass of that for backwards compat.

Mostly only deal with the constructor for now, but go ahead and do
list_flavors and get_flavor_by_id while we're looking at the extra
config override. Also remove list_projects because of its use of the
_normalize module.

keystoneauth lower-constraint needs to be bumped because of
status_code_retries.

Change-Id: Ibbe6e167d6285b30a9adbd0c5a89bc679c5645f3
2018-07-13 06:17:25 -05:00
Zuul d1451d022a Merge "Add proper return value for validate_node" 2018-03-08 23:09:15 +00:00
Olivier Bourdon 592ac2c7d0 Add proper return value for validate_node
Change-Id: I361c520e6697750137e86d32dc3890fd8af4a99c
2018-03-08 10:55:37 +01:00
Olivier Bourdon da6301bc46 Add extra failure codes to bad request exception
For instance on call to cloud.node_set_provision_state(uuid, 'dummy')
the API currently only returns:
(400) Client Error for url: http://127.0.0.1:6385/v1/nodes/<UUID>\
/states/provision Bad Request
whereas the HTTP request also contains some more valuable information
in the body:
The requested action "dummy" can not be performed on node "<UUID>" \
while it is in state "enroll".

Change-Id: I8412a2fd4ba78ad4f43ac2f13b1404dd3c151ce5
2018-03-08 07:35:20 +01:00
Julia Kreger 44bafb8cda Add retry logic mechanism
Added retry logic mechanism and added them to the API calls
where ironic presently attempts to pull an exclusive
lock on the baremetal node.

Change-Id: Ia6fbc9eec612793b3214d7883e0552913a088d5d
2017-12-04 20:15:52 -05:00
Julia Kreger b85cf134d9 Remove python-ironicclient
After an epic battle with time, the python-ironicclient has been
driven from the land of shade, and there will be joy!

Change-Id: I234e2fc9d1800607c22eb447dd3e77428221695e
2017-12-04 04:06:16 +00:00
Julia Kreger f9465f5abe De-client-ify many baremetal calls
Update calls for numerous baremetal methods to utilize
the _baremetal_client calls instead of python-ironicclient.

Also corrected a minor baremetal port test and fixed the
base noauth test endpoint override as python-ironicclient
was previously injecting that for us.

Change-Id: I358a63a52067f7d48d71f0b23652491b2497fe43
2017-12-03 17:35:27 -05:00
Julia Kreger e70e5a586f Add helper to wait until baremetal locks clear
Add a halper to allow the methods to wait until locks
have cleared before proceeding.

Change-Id: I36175cc570fec47484297fd7fc7b6aa7da466d9f
2017-12-03 13:09:41 -05:00
Julia Kreger f667eab384 De-client-ify baremetal node_set_provision_state
Change-Id: I6166ecdac0cf3056d84fad631b7e962ac0873606
2017-11-28 16:55:29 -05:00
Julia Kreger 395d927081 Complete move of baremetal machine tests
Migrating tests to wrap up machine actions.

Ports will be migrated separately as there
will also need to be portgroups, which could
be wrapped into the same file/class depending
on how that ends up being implemented.

Change-Id: I239bbc134f42a47e8df75531dbd50916a97a6068
2017-11-19 01:34:33 -05:00
Monty Taylor 8daf38fb6a Convert test_baremetal_machine_patch to testscenarios
We have a helper library that handles this sort of thing.

Change-Id: I58f50663ab9c026918088845cceecf78ff15d8c8
2017-09-09 18:34:01 +00:00
Julia Kreger b817f47782 Migrate machine tests related to state transitions
Migrating the machine tests where state transitions
occur, such as turning power on/off, maintenance mode,
hardware inspection, and general provision state changes
such as activating a node and deactivating a node.

Change-Id: I88663fecb79247d5473c47847f9c7405f447a80d
2017-09-08 18:53:52 +00:00
Julia Kreger c821c977b9 Migrate machine inspection tests to requests_mock
Change-Id: I53bfeff53d569a8075b40e4fb1087357f7eb4da0
2017-09-08 04:05:56 +00:00
Julia Kreger e8d37f8281 Migrate additional machine tests
Migrated a number of simpler machine tests to using rest calls,
while removing the mocked client versions of the tests.

Added additional patch_machine tests, which raised the fact that
patch method was not normalizing the data being returned.

Added normalization since those fields are not normally returned
by get_machine.

Change-Id: I1c5f4ebd06fff40da45dbcc0d6ea0f7b108ce8fa
2017-09-07 06:10:27 +00:00
Monty Taylor 4de4fb4a5a
Begin converting baremetal node tests
Shamelessly based upon pre-existing requests mock code in
shade, with the attempt to replace the existing baremetal
client mock testing.

This updates the way we're creating the ironic_client so that it
always does discovery, which _baremetal_client will always have
to do because of how the versioned discovery document is in ironic.

It also puts in a workaround for a bug that was found in keystoneauth's
new version discovery that we should eventually take out.

Change-Id: I0e811d69c3cba50f164cb2a3a1302b88fba51308
2017-09-05 13:43:48 -05:00