-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix lxc plugin options (#7369) * Fixture for liblxc Add a fixture to allow testing the lxc connection plugin both with and without liblxc being present. Also change the test from unittest to pytest. * Update liblxc error message The error is not specific to python2, so remove the version. Also add a test for it. * Migrate to options Because the lxc plugin was only using PlayContext properties, using host vars like `ansible_lxc_host` didn't work. This is fixed by instead using the `get_option` method inherited from `AnsiblePlugin`. The options are not yet available in the `__init__` function, so the determination of the container name is moved to the `_connect` method, which is the first time it is actually needed. The default for the `remote_addr` option is removed, because the string `inventory_hostname` is not very useful. At all. This seams to have been spread with copy&paste and a bit of cargo culting. The variable priority already takes care of setting the value. * Add changelog fragment * Fix for Py2.7 `TypeError: super() takes at least 1 argument (0 given)` * Add plugin type to changelog fragment. * Restore untemplated default This partially reverts commit 429d8c8. --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 1bf5a44) Co-authored-by: Corubba <[email protected]>
- Loading branch information
1 parent
07d0de5
commit d4e831f
Showing
3 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- lxc connection plugin - properly evaluate options (https://github.com/ansible-collections/community.general/pull/7369). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters