[PR #5659/af53271c backport][stable-6] lxc_container: fix lxc argument when executing lxc command #5698
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #5659 as merged into main (af53271).
SUMMARY
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.
would result in the lxc command:
lxc template --template
(current result)lxc --template debian
(while this is the correct line)Fixes: 6f88426 ("lxc_container: minor refactor (#5358)")
Fixes #5578
CC: @russoz
ISSUE TYPE
COMPONENT NAME
lxc_container
ADDITIONAL INFORMATION
To reproduce the issue create a container which doesn't exist before:
will execute
/usr/bin/lxc-create --name some --quiet template --template backing_store --bdev -- --dist debian --release bullseye --arch amd64
correct would be
/usr/bin/lxc-create --name some --quiet --template template --bdev dir -- --dist debian --release bullseye --arch amd64