1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix proxmox update when setting does not already exist (#7872)

* fix proxmox update when setting does not already exist

* add changelog fragment

---------

Co-authored-by: Eric Trombly <etrombly@iomaxis.com>
This commit is contained in:
Eric Trombly 2024-01-26 16:29:57 -06:00 committed by GitHub
parent 13e3161f2a
commit 2d3f99ec3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- proxmox - fix updating a container config if the setting does not already exist (https://github.com/ansible-collections/community.general/pull/7872).

View file

@ -562,6 +562,10 @@ class ProxmoxLxcAnsible(ProxmoxAnsible):
# compare the requested config against the current # compare the requested config against the current
update_config = False update_config = False
for (arg, value) in kwargs.items(): for (arg, value) in kwargs.items():
# if the arg isn't in the current config, it needs to be updated
if arg not in current_config:
update_config = True
break
# some values are lists, the order isn't always the same, so split them and compare by key # some values are lists, the order isn't always the same, so split them and compare by key
if isinstance(value, str): if isinstance(value, str):
current_values = current_config[arg].split(",") current_values = current_config[arg].split(",")