mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ensure 'home' translations (#36755)
* ensure 'home' translations * removed slash as it created issues on diff plats
This commit is contained in:
parent
d9430b79f9
commit
cc1c7c63db
6 changed files with 10 additions and 0 deletions
|
@ -569,6 +569,9 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
|
||||
if sudoable and expand_path == '~' and self._play_context.become and self._play_context.become_user:
|
||||
expand_path = '~%s' % self._play_context.become_user
|
||||
else:
|
||||
# use remote user instead, if none set default to current user
|
||||
expand_path = '~%s' % self._play_context.remote_user or self._connection.default_user or ''
|
||||
|
||||
# use shell to construct appropriate command and execute
|
||||
cmd = self._connection._shell.expand_user(expand_path)
|
||||
|
|
|
@ -60,6 +60,8 @@ class ConnectionBase(AnsiblePlugin):
|
|||
supports_persistence = False
|
||||
force_persistence = False
|
||||
|
||||
default_user = None
|
||||
|
||||
def __init__(self, play_context, new_stdin, shell=None, *args, **kwargs):
|
||||
|
||||
super(ConnectionBase, self).__init__()
|
||||
|
|
|
@ -65,6 +65,8 @@ class Connection(ConnectionBase):
|
|||
# Have to look into that before re-enabling this
|
||||
become_methods = frozenset(C.BECOME_METHODS).difference(('su',))
|
||||
|
||||
default_user = 'root'
|
||||
|
||||
def __init__(self, play_context, new_stdin, *args, **kwargs):
|
||||
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ class Connection(ConnectionBase):
|
|||
# checksums (so copy, for instance, doesn't work right)
|
||||
# Have to look into that before re-enabling this
|
||||
become_methods = frozenset(C.BECOME_METHODS).difference(('su',))
|
||||
default_user = 'root'
|
||||
|
||||
def __init__(self, play_context, new_stdin, *args, **kwargs):
|
||||
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
|
||||
|
|
|
@ -55,6 +55,7 @@ class Connection(ConnectionBase):
|
|||
transport = 'lxc'
|
||||
has_pipelining = True
|
||||
become_methods = frozenset(C.BECOME_METHODS)
|
||||
default_user = 'root'
|
||||
|
||||
def __init__(self, play_context, new_stdin, *args, **kwargs):
|
||||
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
|
||||
|
|
|
@ -43,6 +43,7 @@ class Connection(ConnectionBase):
|
|||
|
||||
transport = "lxd"
|
||||
has_pipelining = True
|
||||
default_user = 'root'
|
||||
|
||||
def __init__(self, play_context, new_stdin, *args, **kwargs):
|
||||
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
|
||||
|
|
Loading…
Reference in a new issue