Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
If repository hasn't been published before, publish without fast-foward
Browse files Browse the repository at this point in the history
If repository hasn't been published before and there's no unit
associated with it, no PULP_MANIFEST is published to destination
publish directory.
With this fix, empty manifest is created in destination directory
indicating that published repo is empty

Closes #5659

(cherry picked from commit 9a7cc54)
  • Loading branch information
midnightercz authored and evgeni committed Feb 24, 2020
1 parent 239f76f commit 7cbe422
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion devel/pulp/devel/mock_distributor.py
Expand Up @@ -6,7 +6,7 @@


def get_publish_conduit(type_id=None, existing_units=None, pkg_dir=None, checksum_type="sha",
repodata=None):
repodata=None, last_published=None):
def build_success_report(summary, details):
return PublishReport(True, summary, details)

Expand Down Expand Up @@ -58,6 +58,7 @@ def get_scratchpad():
publish_conduit.build_success_report = build_success_report
publish_conduit.get_repo_scratchpad.side_effect = get_repo_scratchpad
publish_conduit.get_scratchpad.side_effect = get_scratchpad
publish_conduit.last_published = last_published
return publish_conduit


Expand Down
2 changes: 1 addition & 1 deletion server/pulp/plugins/file/distributor.py
Expand Up @@ -71,7 +71,7 @@ def publish_repo(self, repo, publish_conduit, config):
:rtype: pulp.plugins.model.PublishReport
"""
_logger.info(_('Beginning publish for repository <%(repo)s>') % {'repo': repo.id})
if not config.get("force_full", False):
if not config.get("force_full", False) and publish_conduit.last_published:
try:
return self.publish_repo_fast_forward(repo, publish_conduit, config)
except FastForwardUnavailable:
Expand Down

0 comments on commit 7cbe422

Please sign in to comment.