Skip to content

Commit 1d1c7a0

Browse files
committed
Image API v2: make volume_type optional
It is perfectly valid for a Cinder volume to have a volume_type of "none", so don't make the Image API v2 require that one be set. Change-Id: I1a6da8d791fa0ae67cac46eec81bcbcb420729c3 Closes-Bug: #1559344
1 parent f9f6abe commit 1d1c7a0

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)