Fix synchronize action issue with mode

We incorrectly used the 'pull' argument from synchronize, the correct
setting is 'mode'.

Change-Id: I3cf53aa35f255a3cab68271d73d0414cd83b70f4
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-02-23 17:48:07 -05:00
parent 2b34105092
commit 52ec39c73f
1 changed files with 3 additions and 3 deletions

View File

@ -24,13 +24,13 @@ class ActionModule(synchronize.ActionModule):
source = self._task.args.get('src', None)
dest = self._task.args.get('dest', None)
pull = self._task.args.get('pull', False)
mode = self._task.args.get('mode', 'push')
if '--safe-links' not in self._task.args['rsync_opts']:
self._task.args['rsync_opts'].append('--safe-links')
if not pull and not paths._is_safe_path(source):
if mode == 'push' and not paths._is_safe_path(source):
return paths._fail_dict(source, prefix='Syncing files from')
if pull and not paths._is_safe_path(dest):
if mode == 'pull' and not paths._is_safe_path(dest):
return paths._fail_dict(dest, prefix='Syncing files to')
return super(ActionModule, self).run(tmp, task_vars)