Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
small refactor of rsync logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jsingle committed Aug 28, 2015
1 parent 86c0cb7 commit e948e42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dusty/commands/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def read_asset(asset_key):
log_to_client(asset_value(asset_key))

def set_asset(asset_key, local_path):
sync_local_path_to_vm(local_path, asset_vm_path(asset_key), demote=True)
sync_local_path_to_vm(local_path, asset_vm_path(asset_key))

def unset_asset(asset_key):
if not asset_is_set(asset_key):
Expand Down
8 changes: 4 additions & 4 deletions dusty/systems/rsync/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import logging
from subprocess import check_call, CalledProcessError
from subprocess import CalledProcessError

from ... import constants
from ...config import get_config_value
from ...subprocess import check_call_demoted, check_and_log_output_and_error_demoted
from ...subprocess import check_call_demoted, check_and_log_output_and_error
from ...source import Repo
from ...path import parent_dir
from ...log import log_to_client
Expand Down Expand Up @@ -45,9 +45,9 @@ def sync_local_path_to_vm(local_path, remote_path, demote=False):
_ensure_vm_dir_exists(remote_path if is_dir else parent_dir(remote_path))
command = _rsync_command(local_path, remote_path, is_dir=is_dir)
logging.debug('Executing rsync command: {}'.format(' '.join(command)))
check_call(command) if not demote else check_and_log_output_and_error_demoted(command)
check_and_log_output_and_error(command, demote=demote, quiet_on_success=True)

def sync_local_path_from_vm(local_path, remote_path, demote=False, is_dir=True):
command = _rsync_command(local_path, remote_path, is_dir=is_dir, from_local=False)
logging.debug('Executing rsync command: {}'.format(' '.join(command)))
check_call(command) if not demote else check_and_log_output_and_error_demoted(command)
check_and_log_output_and_error(command, demote=demote, quiet_on_success=True)

0 comments on commit e948e42

Please sign in to comment.