Skip to content

Commit

Permalink
Undo fix for #107 which could potentially lead to data loss.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctheune committed May 28, 2021
1 parent c811fad commit 33cae54
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/batou/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class FilteredRSync(execnet.RSync):
avoids copying files from our blacklist.
"""

blacklist = (
IGNORE_LIST = (
".appenv",
".batou",
".batou-lock",
".git",
Expand All @@ -78,10 +79,10 @@ class FilteredRSync(execnet.RSync):

def __init__(self, *args, **kw):
super(FilteredRSync, self).__init__(*args, **kw)
self.blacklist = set(self.blacklist)
self.IGNORE_LIST = set(self.IGNORE_LIST)

def filter(self, path):
return os.path.relpath(path, self._sourcedir) not in self.blacklist
return os.path.basename(path) not in self.IGNORE_LIST


class RSyncRepository(Repository):
Expand All @@ -96,7 +97,10 @@ def update(self, host):
source, target = self.environment.base_dir, host.remote_base
output.annotate("rsync: {} -> {}".format(source, target), debug=True)
rsync = FilteredRSync(source, verbose=False)
rsync.add_target(host.gateway, target, delete=True)
# We really want to use `delete=True` here but there's an execnet issue
# preventing us to use it. See
# https://github.com/flyingcircusio/batou/issues/107
rsync.add_target(host.gateway, target)
rsync.send()


Expand Down

0 comments on commit 33cae54

Please sign in to comment.