1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins
patchback[bot] 02a257569a
[PR #7369/1bf5a44a backport][stable-6] Fix lxc plugin options (#7370)
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 429d8c8cfb.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1bf5a44a77)

Co-authored-by: Corubba <97832352+corubba@users.noreply.github.com>
2023-10-09 09:21:43 +02:00
..
action Unflatmap community.general (#5461) 2022-11-02 20:42:29 +00:00
become [PR #6935/24feb1dd backport][stable-6] machinectl become plugin: mark as require_tty (#6941) 2023-07-15 16:27:19 +02:00
cache [PR #5940/2b8ac3c6 backport][stable-6] Remove unneccessary imports (#5976) 2023-02-12 20:22:44 +01:00
callback [PR #5940/2b8ac3c6 backport][stable-6] Remove unneccessary imports (#5976) 2023-02-12 20:22:44 +01:00
connection [PR #7369/1bf5a44a backport][stable-6] Fix lxc plugin options (#7370) 2023-10-09 09:21:43 +02:00
doc_fragments [PR #6839/e5dc6978 backport][stable-6] proxmox module utils: better error msg when token fails with old proxmoxer (#6845) 2023-07-03 20:57:36 +00:00
filter [PR #7296/756e8f5c backport][stable-6] Update from_csv.py docs (#7299) 2023-09-20 22:44:17 +02:00
inventory [PR #6923/7020b27b backport][stable-6] cobbler inventory plugin: Convert unicode to str (#6952) 2023-07-16 14:39:18 +02:00
lookup [PR #7241/1beb38ce backport][stable-6] Use get(..) instead of [..] for safe lookup of value (Fixes #7240) (#7257) 2023-09-13 06:24:24 +00:00
module_utils [PR #7200/8fa667ee backport][stable-6] CmdRunner bugfix (#7227) 2023-09-10 09:00:20 +02:00
modules [PR #7301/7bf24eeb backport][stable-6] Fixing incorrect string encapsulation for -backend-config. (#7314) 2023-09-25 05:51:19 +02:00
test Fix more copyright lines, add more default copyright lines (#5095) 2022-08-08 14:24:58 +02:00