Skip to content

Commit 376dbd0

Browse files
carlo-luziCarlo LuziThulium-Drake
authored
Fix proxmox_storage does not add PBS parameters to API payload (#170) (#171)
* Fix proxmox_storage does not add PBS parameters to API payload (#170) * Update proxmox_storage.py Fix whitespacing to fix sanity test * chore: Add changelog fragment for #171 * Update changelogs/fragments/171.bugfix.yml --------- Co-authored-by: Carlo Luzi <[email protected]> Co-authored-by: Jeffrey van Pelt <[email protected]>
1 parent a646717 commit 376dbd0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- proxmox_storage - fixed adding PBS-type storage by ensuring its parameters (server, datastore, etc.) are correctly sent to the Proxmox API (https://github.com/ansible-collections/community.proxmox/pull/171).

plugins/modules/proxmox_storage.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,14 @@ def add_storage(self):
350350
datastore = pbs_options.get('datastore')
351351
fingerprint = pbs_options.get('fingerprint')
352352
if not all([server, datastore, username, password]):
353-
self.module.fail_json(msg="PBS storage requires 'server', 'username', 'password', 'datastore' and 'fingerprint' parameters.")
353+
self.module.fail_json(msg="PBS storage requires 'server', 'username', 'password' and 'datastore' parameters.")
354+
else:
355+
payload['server'] = server
356+
payload['username'] = username
357+
payload['password'] = password
358+
payload['datastore'] = datastore
359+
if fingerprint:
360+
payload['fingerprint'] = fingerprint
354361

355362
# Check Mode validation
356363
if self.module.check_mode:

0 commit comments

Comments
 (0)