mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00: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:
@@ -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(",")
|
||||||
|
|||||||
Reference in New Issue
Block a user