Skip to content

Commit

Permalink
skip rsync if there are no files to sync but also only if delete is F…
Browse files Browse the repository at this point in the history
…alse

closes #2221
https://pulp.plan.io/issues/2221

Signed-off-by: Ina Panova <ipanova@redhat.com>
  • Loading branch information
midnightercz authored and ipanova committed Sep 2, 2016
1 parent ecebd9f commit 3944f72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/pulp/plugins/rsync/publish.py
Expand Up @@ -226,8 +226,11 @@ def rsync(self):
generated by rsync command)
:rtype: tuple
"""
if not self.file_list:
if not self.file_list and not self.delete:
return (True, _("Nothing to sync"))
if not os.path.exists(self.src_directory):
os.makedirs(self.src_directory)

output = ""
list_of_files = os.path.join(self.get_working_dir(), str(uuid.uuid4()))
open(list_of_files, 'w').write("\n".join(sorted(self.file_list)))
Expand Down

0 comments on commit 3944f72

Please sign in to comment.