Skip to content

Commit

Permalink
lxc_container: fix lxc argument when executing lxc command
Browse files Browse the repository at this point in the history
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: 6f88426 ("lxc_container: minor refactor (ansible-collections#5358)")
Fixes ansible-collections#5578

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
  • Loading branch information
lynxis committed Dec 5, 2022
1 parent f0b3bba commit c41dce0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/modules/lxc_container.py
Expand Up @@ -677,7 +677,7 @@ def _get_vars(self, variables):

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
)
Expand Down

0 comments on commit c41dce0

Please sign in to comment.