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

lxc_container: fix lxc argument when executing lxc command (#5659)

lxc_container fails when executing the lxc command (e.g. when creating
a new container) because PR#5358 broke the module argument
parsing. The resulting argument dict contained only the module argument name
and the argument flag but not the value. E.g.
```
- lxc_container:
    template: debian
```
would result in lxc command arguments `lxc template --template` instead of
`lxc --template debian`.

Fixes: 6f88426cf1 ("lxc_container: minor refactor (#5358)")
Fixes #5578

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
This commit is contained in:
Alexander Couzens 2022-12-17 12:10:23 +01:00 committed by GitHub
parent f95e0d775d
commit af53271c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- lxc_container - fix the arguments of the lxc command which broke the creation and cloning of containers (https://github.com/ansible-collections/community.general/issues/5578).

View file

@ -677,7 +677,7 @@ class LxcContainerManagement(object):
false_values = BOOLEANS_FALSE.union([None, ''])
result = dict(
(k, v)
(v, self.module.params[k])
for k, v in variables.items()
if self.module.params[k] not in false_values
)