Skip to content

Commit 59ffee2

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Image API v2: make volume_type optional"
2 parents 0a65e8d + 1d1c7a0 commit 59ffee2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

openstackclient/image/v2/image.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,10 @@ def take_action(self, parsed_args):
325325
parsed_args.disk_format,
326326
)
327327
info = body['os-volume_upload_image']
328-
info['volume_type'] = info['volume_type']['name']
328+
try:
329+
info['volume_type'] = info['volume_type']['name']
330+
except TypeError:
331+
info['volume_type'] = None
329332
else:
330333
image = image_client.images.create(**kwargs)
331334

0 commit comments

Comments
 (0)