Changing the size of a volume when cloning a snapshot doesn't
make a great deal of sense *and isn't part of the ec2 api).
This patch makes the field optional, defaulting to the same
size as the snapshot (and therefore the origination volume).
Change-Id: I3fea7fe1c0415d10e549c66a242cf2a336a7204e
volume = body['volume']
- size = volume['size']
-
- LOG.audit(_("Create volume of %s GB"), size, context=context)
-
kwargs = {}
req_volume_type = volume.get('volume_type', None)
else:
kwargs['snapshot'] = None
+ size = volume.get('size', None)
+ if size is None and kwargs['snapshot'] is not None:
+ size = kwargs['snapshot']['volume_size']
+
+ LOG.audit(_("Create volume of %s GB"), size, context=context)
+
image_href = None
image_uuid = None
if self.ext_mgr.is_loaded('os-image-create'):