Skip to content

Commit

Permalink
Update lxd connection to use all documented vars for options (#3798) (#…
Browse files Browse the repository at this point in the history
…3880)

* Update lxd connection to use documented vars

* Add a changelog fragment

* Add clarification to changelog description

* Shorten changelog fragment description

(cherry picked from commit 8f6866d)

Co-authored-by: Conner Crosby <conner@cavcrosby.tech>
  • Loading branch information
patchback[bot] and cavcrosby authored Dec 9, 2021
1 parent 587d221 commit 2086977
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
minor_changes:
- lxd connection plugin - make sure that ``ansible_lxd_host``, ``ansible_executable``, and
``ansible_lxd_executable`` work (https://github.com/ansible-collections/community.general/pull/3798).
8 changes: 4 additions & 4 deletions plugins/connection/lxd.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def exec_command(self, cmd, in_data=None, sudoable=True):
local_cmd.extend(["--project", self.get_option("project")])
local_cmd.extend([
"exec",
"%s:%s" % (self.get_option("remote"), self._host),
"%s:%s" % (self.get_option("remote"), self.get_option("remote_addr")),
"--",
self._play_context.executable, "-c", cmd
self.get_option("executable"), "-c", cmd
])

local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
Expand Down Expand Up @@ -126,7 +126,7 @@ def put_file(self, in_path, out_path):
local_cmd.extend([
"file", "push",
in_path,
"%s:%s/%s" % (self.get_option("remote"), self._host, out_path)
"%s:%s/%s" % (self.get_option("remote"), self.get_option("remote_addr"), out_path)
])

local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
Expand All @@ -145,7 +145,7 @@ def fetch_file(self, in_path, out_path):
local_cmd.extend(["--project", self.get_option("project")])
local_cmd.extend([
"file", "pull",
"%s:%s/%s" % (self.get_option("remote"), self._host, in_path),
"%s:%s/%s" % (self.get_option("remote"), self.get_option("remote_addr"), in_path),
out_path
])

Expand Down

0 comments on commit 2086977

Please sign in to comment.