Skip to content

Commit

Permalink
Make sure either 'host' or 'remote' is set in rsync function
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHammarstedt committed Jun 28, 2022
1 parent 33a623c commit b26e8e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sparv/api/util/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
logger = get_logger(__name__)


def install_file(local_file, host, remote_file):
def install_file(local_file, host=None, remote_file=None):
"""Rsync a file to a target host."""
system.rsync(local_file, host, remote_file)

Expand Down
1 change: 1 addition & 0 deletions sparv/api/util/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def rsync(local, host=None, remote=None):
When syncing directories, extraneous files in destination dirs are deleted.
"""
assert host or remote, "Either 'host' or 'remote' must be set."
if remote is None:
remote = local
remote_dir = os.path.dirname(remote)
Expand Down

0 comments on commit b26e8e8

Please sign in to comment.