diff --git a/CHANGES.md b/CHANGES.md index b82f7bf2a..82d302ba7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,8 @@ bubbled incorrectly and caused spurious deployment errors. - Add new `rsync-ext` repository type which uses an external rsync binary for repository synchronisation. +- Fix bug where the SyncDirectory component errors out because the target directory + does not exist yet. ## 2.4rc1 (2023-09-12) diff --git a/src/batou/lib/file.py b/src/batou/lib/file.py index b52ba5d9e..02a813751 100644 --- a/src/batou/lib/file.py +++ b/src/batou/lib/file.py @@ -204,6 +204,9 @@ def exclude_arg(self): return " ".join("--exclude '{}'".format(x) for x in self.exclude) + " " def verify(self): + if not os.path.isdir(self.path): + raise batou.UpdateNeeded() + stdout, stderr = self.cmd( "rsync {} {}{}/ {}".format( self.verify_opts, self.exclude_arg, self.source, self.path