mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-18 20:44:16 +03:00
proxmox_disk: fail gracefully if storage hasn't been provided by the user (#9963)
Fail gracefully if storage hasn't been provided by the user.
This commit is contained in:
parent
70b5e362f9
commit
34b6fb74eb
2
changelogs/fragments/9963-proxmox_disk-storage.yml
Normal file
2
changelogs/fragments/9963-proxmox_disk-storage.yml
Normal file
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "proxmox_disk - fail gracefully if ``storage`` is required but not provided by the user (https://github.com/ansible-collections/community.general/issues/9941, https://github.com/ansible-collections/community.general/pull/9963)."
|
@ -554,6 +554,8 @@ class ProxmoxDiskAnsible(ProxmoxAnsible):
|
||||
ok_str = "CD-ROM was created on %s bus in VM %s"
|
||||
else:
|
||||
config_str = self.module.params["storage"]
|
||||
if not config_str:
|
||||
self.module.fail_json(msg="The storage option must be specified.")
|
||||
if self.module.params.get("media") != "cdrom":
|
||||
config_str += ":%s" % (self.module.params["size"])
|
||||
ok_str = "Disk %s created in VM %s"
|
||||
|
Loading…
x
Reference in New Issue
Block a user