Merge pull request #39171 from techhat/issue38370

Raise an error for a disk size that is too small
This commit is contained in:
Mike Place 2017-02-06 11:19:45 -07:00 committed by GitHub
commit 6f9251ebed

View file

@ -647,6 +647,12 @@ def _manage_devices(devices, vm=None, container_ref=None):
if device.capacityInKB < size_kb:
# expand the disk
disk_spec = _edit_existing_hard_disk_helper(device, size_kb)
elif device.capacityInKB > size_kb:
raise SaltCloudSystemExit(
'The specified disk size is smaller than the '
'size of the disk image. It must be equal to '
'or greater than the disk image'
)
if 'mode' in devices['disk'][device.deviceInfo.label]:
if devices['disk'][device.deviceInfo.label]['mode'] \