From ea176427b47e6d45248466d06bb5ad7f8d1ad5e8 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 21 May 2018 12:04:25 -0500 Subject: [PATCH] Group logic detecting user, ensure rsync_opts is a list if omitted. Fixes #40483 --- lib/ansible/modules/files/synchronize.py | 2 +- lib/ansible/plugins/action/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/synchronize.py b/lib/ansible/modules/files/synchronize.py index 58f92254aa5..616cfcbdee2 100644 --- a/lib/ansible/modules/files/synchronize.py +++ b/lib/ansible/modules/files/synchronize.py @@ -366,7 +366,7 @@ def main(): group=dict(type='bool'), set_remote_user=dict(type='bool', default=True), rsync_timeout=dict(type='int', default=0), - rsync_opts=dict(type='list'), + rsync_opts=dict(type='list', default=[]), ssh_args=dict(type='str'), partial=dict(type='bool', default=False), verify_host=dict(type='bool', default=False), diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index cfdc5055db5..5f8529424b9 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -583,7 +583,7 @@ class ActionBase(with_metaclass(ABCMeta, object)): 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 '' + 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)