Skip to content

Commit

Permalink
Fixed bug in sync logic whereby sync action was causing local dir to …
Browse files Browse the repository at this point in the history
…be nested in remote
  • Loading branch information
Tejeda, Engelbert committed Oct 4, 2019
1 parent 6bc786e commit 6fe86b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ansible_taskrunner/libs/providers/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def invoke_bastion_mode(self, bastion_settings, invocation):
mkdir_result = remote_sub_process.call('/', cmd)
if mkdir_result:
logger.info("Performing initial sync to %s ..." % remote_dir)
sftp_sync.to_remote(local_dir, remote_dir)
sftp_sync.to_remote('.', remote_dir)
rem_exists = True
else:
logger.error('Unable to create remote path!')
Expand All @@ -134,7 +134,8 @@ def invoke_bastion_mode(self, bastion_settings, invocation):
# that have changed within the last 5 minutes
_dir = os.getcwd()
local_changed = (fle for rt, _, f in os.walk(_dir) for fle in f if time.time() - os.stat(os.path.join(rt, fle)).st_mtime < 300)
local_changed = [f for f in os.listdir('.') if os.path.isfile(f)]
exclusions = ['sftp-config.json']
local_changed = [f for f in os.listdir('.') if os.path.isfile(f) and f not in exclusions]
logger.info('Checking for remotely changed files ...')
no_clobber = settings.get('at_no_clobber')
if rem_is_git:
Expand Down

0 comments on commit 6fe86b9

Please sign in to comment.