openstacksdk/openstack/tests/unit/fixtures
Artem Goncharov 232553daf7 Move image methods to sdk image proxy
We have excellent image uploading code - people should get to use it
whether they use the abstraction layer or not.

The sdk is version specific, so we can split v1 and v2 using those
classes. Make a base class for both proxies so that we can define a
general interface and handle some of the argument normalization
and processing.

NOTE: This is very unfinished. The proxy methods should be transformed
to using the Resource layer. There are many places where calls back in
to the Connection haven't had self._connection pre-pended to them.

The wait logic needs to be reworked. We should make a v2.ImageTask
resource (I think) with a wait method - and a v2.Image with a
wait method so that we can have a proxy wait_for_image method that will
work fully for put and task. Then we should remove the wait loops from
the shade layer and have it call self.image.wait_for_image(image) if
wait/timeout have been passed.

At the end of this, create_image in shade should basically be:

  if volume:
    self.block_storage.create_image()
  else:
    self.image.create_image()
  if wait:
    self.image.wait_for_image(wait, timeout)

This is also a straw man for a general approach to shifting important
logic into the sdk layer so that it can be shared, but also keep things
like the wait/timeout and "call image or block-storage api calls"
in shade.

The block_storage.create_image is going to be interesting - because it
realy needs to return an Image resource. I think the existing code is
racey/buggy - because for not-wait it returns get_image(image_id) - but
I'm pretty sure that can't possibly be guaranteed to exist that instant.
However, with Image resource we can just create a blank Image object
with image_id filled in, and that blank object can be used as a
parameter to wait_for_image.

Change-Id: Idfeb25e8d6b20d7f5ea218aaf05af9a52fb1cfb8
2019-02-28 15:10:30 +00:00
..
clouds Filter ports in list_ports when batching is in effect 2018-10-30 09:35:30 -05:00
baremetal.json Merge tox, tests and other support files 2017-10-04 14:51:08 -05:00
block-storage-version.json Move image methods to sdk image proxy 2019-02-28 15:10:30 +00:00
catalog-v2.json Merge "Adds Senlin support to openstacksdk" 2018-06-22 00:10:34 +00:00
catalog-v3-suburl.json Adds Senlin support to openstacksdk 2018-06-21 07:24:00 -05:00
catalog-v3-suffix.json Fix neutron endpoint mangling 2018-11-09 10:27:21 -06:00
catalog-v3.json Merge "Adds Senlin support to openstacksdk" 2018-06-22 00:10:34 +00:00
clustering.json Move clustering additions from shade directories 2018-06-25 10:57:33 -05:00
compute-version.json Pass default_microversion to adapter constructor 2018-06-09 09:15:20 -05:00
discovery.json Merge tox, tests and other support files 2017-10-04 14:51:08 -05:00
dns.json Merge tox, tests and other support files 2017-10-04 14:51:08 -05:00
image-version-broken.json Merge tox, tests and other support files 2017-10-04 14:51:08 -05:00
image-version-suburl.json Handle glance image pagination links better 2017-11-15 09:04:00 -06:00
image-version-v1.json Merge tox, tests and other support files 2017-10-04 14:51:08 -05:00
image-version-v2.json Merge tox, tests and other support files 2017-10-04 14:51:08 -05:00
image-version.json Merge tox, tests and other support files 2017-10-04 14:51:08 -05:00
placement.json Add tests to verify behavior on '' in self link 2018-06-18 12:43:44 -05:00