[stable 7.0]Add wait for active image status
To be sure that image is ready to create volume with it, add wait for image status. Also make image public and set name to it. Closes-Bug: #1507987 Change-Id: Ibb87e692a2b0ee36d220d107e2ae9ba500485eab
This commit is contained in:
parent
dd28187642
commit
e9644e5d5c
|
@ -355,7 +355,8 @@ class OpenStackActions(common.Common):
|
|||
def create_image(self, **kwargs):
|
||||
image = self.glance.images.create(**kwargs)
|
||||
logger.info("Created image: '{0}'".format(image.id))
|
||||
return self.glance.images.get(image.id)
|
||||
logger.info("Image status: '{0}'".format(image.status))
|
||||
return image
|
||||
|
||||
def get_image_list(self):
|
||||
return self.glance.images.list()
|
||||
|
|
|
@ -117,7 +117,12 @@ class CephCompact(TestBasic):
|
|||
image_data = BytesIO(bytearray(self.__class__.__name__))
|
||||
image = os_conn.create_image(disk_format='raw',
|
||||
container_format='bare',
|
||||
name='test_ceph_cinder_cow',
|
||||
is_public=True,
|
||||
data=image_data)
|
||||
wait(lambda: os_conn.get_image(image.name).status == 'active',
|
||||
timeout=60 * 2, timeout_msg='Image is not active')
|
||||
|
||||
volume = os_conn.create_volume(size=1, image_id=image.id)
|
||||
|
||||
remote = self.fuel_web.get_ssh_for_node('slave-01')
|
||||
|
|
Loading…
Reference in New Issue