Skip to content

Commit

Permalink
Remove HOME Env Variable from get_remote_workflow_run_dir (#5115)
Browse files Browse the repository at this point in the history
* Remove HOME env var from rsync commands
  • Loading branch information
datamel authored Sep 9, 2022
1 parent ca2ab09 commit 00d7890
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Maintenance release.

### Fixes

[#5115](https://github.com/cylc/cylc-flow/pull/5115) - Updates rsync commands
to make them compatible with latest rsync releases.

[#5119](https://github.com/cylc/cylc-flow/pull/5119) - Fix formatting of
deprecation warnings at validation.

Expand Down
1 change: 1 addition & 0 deletions cylc/flow/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def construct_rsync_over_ssh_cmd(
``rsync_cmd[0] == 'rsync'``. Please check that changes to this funtion
do not break ``rsync_255_fail``.
"""
dst_path = dst_path.replace('$HOME/', '')
dst_host = get_host_from_platform(platform, bad_hosts=bad_hosts)
ssh_cmd = platform['ssh command']
command = platform['rsync command']
Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/subprocpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def rsync_255_fail(ctx, platform=None) -> bool:
"""Tests context for rsync failing to communicate with a host.
If there has been a failure caused by rsync being unable to connect
try a test of ssh connectivity. Necessary becuase loss of connectivity
try a test of ssh connectivity. Necessary because loss of connectivity
may cause different rsync failures depending on version, and some of
the failures may be caused by other problems.
"""
Expand Down
4 changes: 3 additions & 1 deletion cylc/flow/task_events_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,9 @@ def _process_job_logs_retrieval(self, schd, ctx, id_keys):
# Remote source
cmd.append("%s:%s/" % (
host,
get_remote_workflow_run_job_dir(schd.workflow)))
get_remote_workflow_run_job_dir(
schd.workflow).replace('$HOME/', ''))
)
# Local target
cmd.append(get_workflow_run_job_dir(schd.workflow) + "/")
self.proc_pool.put_command(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ sed 's/^.* -v //' "${WORKFLOW_LOG_D}/scheduler/my-rsync.log" >'my-rsync.log.edit

OPT_HEAD='--include=/1 --include=/1/t1'
OPT_TAIL='--exclude=/**'
ARGS="${CYLC_TEST_HOST}:\$HOME/cylc-run/${WORKFLOW_NAME}/log/job/ ${WORKFLOW_LOG_D}/job/"
ARGS="${CYLC_TEST_HOST}:cylc-run/${WORKFLOW_NAME}/log/job/ ${WORKFLOW_LOG_D}/job/"
cmp_ok 'my-rsync.log.edited' <<__LOG__
${OPT_HEAD} --include=/1/t1/01 --include=/1/t1/01/** ${OPT_TAIL} ${ARGS}
${OPT_HEAD} --include=/1/t1/02 --include=/1/t1/02/** ${OPT_TAIL} ${ARGS}
Expand Down

0 comments on commit 00d7890

Please sign in to comment.