[PR #9963/34b6fb74 backport][stable-10] proxmox_disk: fail gracefully if storage hasn't been provided by the user (#9968)

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.

(cherry picked from commit 34b6fb74eb)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2025-04-06 14:24:07 +02:00 committed by GitHub
parent 88f5100657
commit 2d730da8a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -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"