mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-06 14:14:22 -07:00
fix: better logging
This commit is contained in:
parent
cce1c3c099
commit
478b25c636
1 changed files with 2 additions and 3 deletions
|
@ -167,12 +167,12 @@ class Connection(ConnectionBase):
|
||||||
|
|
||||||
rc, uid_out, err = self.exec_command("/bin/id -u")
|
rc, uid_out, err = self.exec_command("/bin/id -u")
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
raise AnsibleError(f"Failed to get remote uid: {err.strip()}")
|
raise AnsibleError(f"Failed to get remote uid for user {self.get_option('remote_user')}: {err}")
|
||||||
uid = uid_out.strip()
|
uid = uid_out.strip()
|
||||||
|
|
||||||
rc, gid_out, err = self.exec_command("/bin/id -g")
|
rc, gid_out, err = self.exec_command("/bin/id -g")
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
raise AnsibleError(f"Failed to get remote gid: {err.strip()}")
|
raise AnsibleError(f"Failed to get remote gid for user {self.get_option('remote_user')}: {err}")
|
||||||
gid = gid_out.strip()
|
gid = gid_out.strip()
|
||||||
|
|
||||||
return uid, gid
|
return uid, gid
|
||||||
|
@ -200,7 +200,6 @@ class Connection(ConnectionBase):
|
||||||
in_path,
|
in_path,
|
||||||
f"{self.get_option('remote')}:{self._host()}/{out_path}"
|
f"{self.get_option('remote')}:{self._host()}/{out_path}"
|
||||||
])
|
])
|
||||||
self._display.vvvvv(f"PUT COMMAND: {local_cmd}", host=self._host())
|
|
||||||
|
|
||||||
local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
|
local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue