mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Raise an error for a disk size that is too small
This commit is contained in:
parent
8c0dc9162a
commit
671282656a
1 changed files with 8 additions and 0 deletions
|
@ -644,9 +644,17 @@ def _manage_devices(devices, vm=None, container_ref=None):
|
|||
' Using existing disk size.')
|
||||
size_kb = device.capacityInKB
|
||||
|
||||
log.debug('device capacity is {0}'.format(device.capacityInKB))
|
||||
log.debug('specified capacity is {0}'.format(size_kb))
|
||||
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'] \
|
||||
|
|
Loading…
Add table
Reference in a new issue