Fix create_image_snapshot
This method from novaclient returns an image id, not an object as was apparently assumed. Before returning, perform an image lookup so that we can return a Bunch() object of the image. Note that if the provider does not immediately make an image available for lookups, this will fail and the user will have no record of the image id. Notably, because it worked with the image_id until the image was built, nodepool was not suceptible to this problem. I am unsure whether there are any clouds that might behave in this way. However, this code matches what we do in shade with servers. Change-Id: Icaff5d8e66a2458817fcbced16014efbc5ff33b8
This commit is contained in:
@@ -1408,11 +1408,9 @@ class OpenStackCloud(object):
|
||||
return None
|
||||
|
||||
def create_image_snapshot(self, name, server, **metadata):
|
||||
image = self.manager.submitTask(_tasks.ImageSnapshotCreate(
|
||||
image_name=name, server=server, metadata=metadata))
|
||||
if image:
|
||||
return meta.obj_to_dict(image)
|
||||
return None
|
||||
image_id = str(self.manager.submitTask(_tasks.ImageSnapshotCreate(
|
||||
image_name=name, server=server, metadata=metadata)))
|
||||
return self.get_image(image_id)
|
||||
|
||||
def delete_image(self, name_or_id, wait=False, timeout=3600):
|
||||
image = self.get_image(name_or_id)
|
||||
|
||||
Reference in New Issue
Block a user