mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #7872/2d3f99ec backport][stable-8] fix proxmox update when setting does not already exist (#7898)
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>
(cherry picked from commit 2d3f99ec3a
)
Co-authored-by: Eric Trombly <etrombly@yahoo.com>
This commit is contained in:
parent
7009a768a4
commit
0aa9cd0e30
2 changed files with 6 additions and 0 deletions
|
@ -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).
|
|
@ -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(",")
|
||||||
|
|
Loading…
Reference in a new issue