mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-04 13:14:24 -07:00
[PR #9322/d539b00d backport][stable-10] connection plugins: use f-strings (#9358)
connection plugins: use f-strings (#9322)
* connection plugins: use f-strings
* add changelog frag
(cherry picked from commit d539b00d4c
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
122086e83b
commit
a13a6d284c
11 changed files with 105 additions and 99 deletions
|
@ -72,7 +72,7 @@ class Connection(ConnectionBase):
|
|||
raise AnsibleError("Internal Error: this module does not support optimized module pipelining")
|
||||
|
||||
# totally ignores privilege escalation
|
||||
display.vvv("EXEC %s" % cmd, host=self.host)
|
||||
display.vvv(f"EXEC {cmd}", host=self.host)
|
||||
p = self.client.command.run(cmd)[self.host]
|
||||
return p[0], p[1], p[2]
|
||||
|
||||
|
@ -87,14 +87,14 @@ class Connection(ConnectionBase):
|
|||
""" transfer a file from local to remote """
|
||||
|
||||
out_path = self._normalize_path(out_path, '/')
|
||||
display.vvv("PUT %s TO %s" % (in_path, out_path), host=self.host)
|
||||
display.vvv(f"PUT {in_path} TO {out_path}", host=self.host)
|
||||
self.client.local.copyfile.send(in_path, out_path)
|
||||
|
||||
def fetch_file(self, in_path, out_path):
|
||||
""" fetch a file from remote to local """
|
||||
|
||||
in_path = self._normalize_path(in_path, '/')
|
||||
display.vvv("FETCH %s TO %s" % (in_path, out_path), host=self.host)
|
||||
display.vvv(f"FETCH {in_path} TO {out_path}", host=self.host)
|
||||
# need to use a tmp dir due to difference of semantic for getfile
|
||||
# ( who take a # directory as destination) and fetch_file, who
|
||||
# take a file directly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue