From a9c6d55b1a79d648ab779f40d8cc43e0b418fed9 Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Mon, 5 Jun 2017 09:46:09 -0400 Subject: [PATCH] Fix rsync publishing units it shouldn't Fixes an issue with rsync logic where some units which have not yet been published by the predistributor are included with rsync publishes. closes #2791 https://pulp.plan.io/issues/2791 (cherry picked from commit 82651e04a3ea2308a6c6a38a70128abe058a6f05) --- server/pulp/plugins/rsync/publish.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/pulp/plugins/rsync/publish.py b/server/pulp/plugins/rsync/publish.py index 431992283f..70cfc65498 100644 --- a/server/pulp/plugins/rsync/publish.py +++ b/server/pulp/plugins/rsync/publish.py @@ -348,6 +348,10 @@ def __init__(self, repo, publish_conduit, config, distributor_type): else: date_filter = None + if self.predistributor: + end_date = self.predistributor["last_publish"] + date_filter = self.create_date_range_filter(None, end_date=end_date) + self.symlink_list = [] self.content_unit_file_list = [] self.symlink_src = os.path.join(self.get_working_dir(), '.relative/') @@ -368,10 +372,12 @@ def is_fastforward(self): force_full |= predistributor_force_full if entry.get("result", "error") == "error": force_full = True + if self.last_published: last_published = self.last_published.replace(tzinfo=None) else: last_published = None + if self.last_deleted: last_deleted = self.last_deleted.replace(tzinfo=None) else: