mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #39171 from techhat/issue38370
Raise an error for a disk size that is too small
This commit is contained in:
commit
6f9251ebed
1 changed files with 6 additions and 0 deletions
|
@ -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'] \
|
||||
|
|
Loading…
Add table
Reference in a new issue