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
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
shade depends on openstacksdk already. Let's go ahead and start
consuming it directly rather than through the os-client-config compat
layer. We have to leave the os-client-config depend for the legacy
client functions.
Change-Id: Ibe2176c16e29960e9cc2b569325e41d1a4e297a8
Moved baremetal port tests to a separate file and
updated them to utilize the new testing method.
Additionally, normalized the output of the port lists as
noise is introduced that is not needed.
Change-Id: I60492cca893e823cb2f9937405c75e23cc42807d
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
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
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
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
Since we are actually to munch objects and not dict,
let's rename them to obj_to_munch and obj_list_to_munch.
Change-Id: Id4d77520237503bbfede89638675402d143fffcd
Signed-off-by: Rosario Di Somma <rosario.disomma@dreamhost.com>
Add the various plumbing and convert one test.
Also, ironicclient prepends "v1" to all of its calls (joy) so there is
an ugly transition related to version discovery coming with this one.
For now just prepend it in our mock base class. When we convert calls,
we'll have to prepend v1 at the call site until we're done with the
transition. Then we can do a followup patch that'll do discovery and
remove the v1 from the code. Gross.
Change-Id: Icfd70267910d19a7da2ae8e9b9e4f24d2077b87d
We have a version of OCC coming out that fixes how keystoneclient is
constructed. The fix is good - however, it breaks a couple of places
where we're mocking to the old behavior. This will all go away once
we're done with keystoneclient-ectomy, so for now just put in a version
detection switch.
Change-Id: I9d4908ef12d40868dc207b130e3244577b9870e9
As shade is no longer an Infra project, it's no longer appropriate to
ignore hacking. Luckily, shade is mostly hacking clean anyway, so this
isn't terribly disruptive.
Change-Id: I607f1835abb328e3b4a4a33d80a1848ab11779be
When 'wait' is enabled in node_set_provision_state, exception should be
raised when machine failure occurred.
Change-Id: I5cc96127b4f44fdadbe75f5df5264565d4e646c9
Finally, the long awaited beginning of the removal of the client
libraries is upon us. Marvel in the wonder that is just making direct
REST calls. Allow yourself to be excited that soon we'll lose the
dependency on warlock.
Change-Id: I9d9f3b4762f9f61c5f325f9e47ea09a1261b02b3
It literally doesn't matter, but also getting deprecation warnings is
equally silly. Change the deprecated things to the non-deprecated one,
and then enable the check that prevents this from happening in the first
place.
Change-Id: Icd714da7ee881fad0c201e9cd56b32a4a330a431
We need to do things to protect against local environment leaking into
the test fixtures when we create the cloud objects. Those things are all
done in the base unittest TestCase class, but for reasons that are hard
to fathom, we ignore that and create our own clouds in many of the
unitttest classes. This leads to problems if a user running the
unittests has cache config information in their local clouds.yaml.
Fix it.
Change-Id: I022d541d8e98bf4b6691bf0a91e3b7d20b2b7456
Original shade support for ironic node activation and deactivation
was without support for a wait option being passed into the helper
methods.
So the os_ironic_node module can be updated to support wait=True,
we need to add support in the activate_node and deactivate_node
methods.
Change-Id: I69eee2d254cde2fffcf0c1ac7679a623fa7f97a5
The existing test for list_hypervisors() did not go deep enough
into the call stack to test the actual underlying nova client call.
Change-Id: I1d4cd9bc9424dfed6554794fa7a80db74cdac8a3
More things than shade need consistent Session creation, so we moved
a copy of the shade code into os-client-config to allow python-*client
to consume the same logic. Now that it's there, consume it in shade and
remove the need for shade to know/duplicate the logic.
Depends-On: Ide4c613cc143a0b8a3f36130989b57e808b2530f
Change-Id: I86cdb3cdd2710ef302520184ccfcb1605384f706
While testing running an inventory on a clouds.yaml with 17 clouds,
errors popped up that were opaque. These are mainly just the things
I noticed doing that.
Change-Id: If3f0dc85b7a8d5a510f9f7b561f3c49edd817908
The new ironic inspection tests has a timeout that appears may
be too aggressively low, which may be causing the iterator to give
up before yielding even once, on a random basis.
Change-Id: I18d447e092c74e21edcc7f90f36112d8c87ffee7
Ironic supports an inspect verb which directs ironic to boot
the node into a special firmware image in order to collect
properties from the remote node.
Change-Id: I4ba3f0cf4ad6f5466e52f5d034bb217f06eec7dd
Addition of wait/timeout support for node_set_provision_state to
block the method until the machine has entered the desired state.
Combined with this, node_set_provision_state will now return the
state of the machine as opposed to just passing through the default
from the ironicclient node set provision state call.
Change-Id: I3e0bfe9e4612291dc77bd683479f7f99aef50d0a
We log exceptions to debug log, but checking for the existence of a
service is normal flow. Don't throw an exception when we can just
return None and have everything work without spamming logs.
Change-Id: I35f431b12c16e085c0e256cad514134066e15a39
Shade's node deletion logic removes ports one at a time in
the requested order, however that logic has been silently failing
to the API for some time now as we're inadvertently returning the
entire port object back to the API as the port we wish to delete
instead of the port UUID.
Changed to return the port UUID value to the delete call.
Added code to unit test to ensure that correct action is taken.
Closes-Bug: #1500063
Change-Id: I01c16990dc66988fab29c41ec4b4e6094213b2ca
This is being split out from keystoneclient. That's a happymaking.
In order to make this work, we also need to fix glance image data upload
for v2 put. It seems that the internal interface has changed. Pass the file
object and not a size. We could do the work to figure out how to do it
in two discreet steps, but I believe that would involved a chunk of
engineering on a dead interface and is not worth it.
Also, Change ignore-errors to ignore_errors
Change-Id: I816752f8f4d29e40d41622bd8a271eb5c8e5a9fb
Additional logic to preemptively prevent NIC removal when a
machine is unregistered by pre-validating if a node is can be
safely deleted.
Change-Id: I55152de9d42143be3b8a4e3da00da0bc0ec88dff
Addition of logic for the ironic enroll state which will
ultimately permit a newer client library version.
Change-Id: I85fe0f2b2f0e6766928f9fb23cb1a8177779008c
Assume that a cloud config object will be passed in. For compat,
create one and pass in kwargs if it's not - but based the internal
operation on the existence of a cloud_config object.
Change-Id: I31b2d851e0636c7742468aa62565295a2c5266e2
Depends-On: I8764ed68f8a38563c4242d4b50e2158e99ed4109