mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 15:15:26 +01:00
maintain proper formating of the remote paths when defined as user@host:/... or host:/...
fixes #360
This commit is contained in:
parent
6d5145e285
commit
12ecc3823b
1 changed files with 8 additions and 1 deletions
|
|
@ -77,7 +77,14 @@ class ActionModule(ActionBase):
|
|||
|
||||
if self._host_is_ipv6_address(host):
|
||||
return '[%s%s]:%s' % (user_prefix, host, path)
|
||||
return '%s%s:%s' % (user_prefix, host, path)
|
||||
|
||||
#preserve formatting of remote paths if host or user@host is explicitly defined in the path
|
||||
if ':' not in path:
|
||||
return '%s%s:%s' % (user_prefix, host, path)
|
||||
elif '@' not in path:
|
||||
return '%s%s' % (user_prefix, path)
|
||||
else:
|
||||
return path
|
||||
|
||||
def _process_origin(self, host, path, user):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue