Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Core: fix the rsync up issue when container is not started yet (#1817)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrychenhf committed Aug 30, 2023
1 parent b1fe415 commit ab45a59
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@ def run_rsync_up(self, source, target, options=None):
do_with_rsync = self._check_container_status() and not options.get(
"docker_mount_if_possible", False)
identical = False if do_with_rsync else True

is_source_dir = os.path.isdir(source)
identifier_path = None
if not is_source_dir and (
target[-1] == "/" or self._is_directory(target)):
# target needs the source name
identical = True
identifier_path = source
is_source_dir = False
if do_with_rsync:
is_source_dir = os.path.isdir(source)
if not is_source_dir and (
target[-1] == "/" or self._is_directory(target)):
# source is file and target is directory, target needs the source name
identical = True
identifier_path = source

host_destination = get_docker_host_mount_location_for_object(
self.host_command_executor.cluster_name, target,
Expand Down Expand Up @@ -165,13 +166,14 @@ def run_rsync_down(self, source, target, options=None):
options = options or {}
do_with_rsync = not options.get("docker_mount_if_possible", False)
identical = False if do_with_rsync else True

# Check the source is a file or a directory
is_source_dir = self._is_directory(source)
if not is_source_dir and (
target[-1] == "/" or os.path.isdir(target)):
# target needs the source name
identical = True
is_source_dir = False
if do_with_rsync:
# Check the source is a file or a directory
is_source_dir = self._is_directory(source)
if not is_source_dir and (
target[-1] == "/" or os.path.isdir(target)):
# target needs the source name
identical = True

host_source = get_docker_host_mount_location_for_object(
self.host_command_executor.cluster_name, source,
Expand Down

0 comments on commit ab45a59

Please sign in to comment.