Fail if referenced source image for a new volume does not exist

Story: 2008926
Task: 42525
Change-Id: I867d6869744528aae3034a7e0add2d0e922a97ff
This commit is contained in:
Christian Rohmann
2021-05-26 18:21:08 +02:00
parent d4033b4cea
commit 82792ab5d5

View File

@@ -188,6 +188,8 @@ class VolumeModule(OpenStackModule):
)
if self.params['image']:
image_id = self.conn.get_image_id(self.params['image'])
if not image_id:
self.fail_json(msg="Failed to find image '%s'" % self.params['image'])
volume_args['imageRef'] = image_id
if self.params['volume']: