1
0
Fork 0
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:
Brian Coca 2018-04-11 11:53:05 -04:00 committed by GitHub
parent d9430b79f9
commit cc1c7c63db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 0 deletions

View file

@ -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)

View file

@ -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__()

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)