Skip to content

Commit

Permalink
feed_url looks closer to sources.list
Browse files Browse the repository at this point in the history
closes #2763
  • Loading branch information
mibanescu committed May 22, 2017
1 parent de4c554 commit 58f086e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions plugins/pulp_deb/plugins/importers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,20 @@ def __init__(self, repo, conduit, config):
self.description = _('Syncing Repository')

self.apt_repo_meta = None
self.feed_url = self.get_config().get('feed')
# https://pulp.plan.io/issues/2765 should remove the need to hardcode
# the dist/component here
self.feed_url = self.get_config().get('feed').strip('/') + '/dists/stable/'
self.release_file = os.path.join(self.get_working_dir(),
"Release")
self.available_units = None
rel_url = urlparse.urljoin(self.feed_url, 'Release')
_logger.info("Downloading %s", rel_url)
self.add_child(publish_step.DownloadStep(
constants.SYNC_STEP_RELEASE_DOWNLOAD,
plugin_type=ids.TYPE_ID_IMPORTER,
description=_('Retrieving metadata: release file'),
downloads=[
DownloadRequest(urlparse.urljoin(self.feed_url, 'Release'),
self.release_file)]))
DownloadRequest(rel_url, self.release_file)]))
self.add_child(ParseReleaseStep(constants.SYNC_STEP_RELEASE_PARSE))
self.step_download_Packages = publish_step.DownloadStep(
constants.SYNC_STEP_PACKAGES_DOWNLOAD,
Expand Down
6 changes: 3 additions & 3 deletions plugins/test/unit/plugins/importers/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_ParseReleaseStep(self):

# Make sure we got a request for the best compression
self.assertEquals(
['http://example.com/main/binary-amd64/Packages.bz2'],
['http://example.com/dists/stable/main/binary-amd64/Packages.bz2'],
[x.url for x in self.step.step_download_Packages.downloads])
self.assertEquals(
[os.path.join(
Expand All @@ -93,7 +93,7 @@ def test_ParseReleaseStep_too_many_comp_arches(self, _AptRepoMeta):
with self.assertRaises(exceptions.PulpCodedTaskFailedException) as ctx:
step.process_lifecycle()
self.assertEquals(
'Unable to sync repo1 from http://example.com/: expected one comp, got 2',
'Unable to sync repo1 from http://example.com/dists/stable/: expected one comp, got 2',
str(ctx.exception))

def _mock_repometa(self):
Expand Down Expand Up @@ -195,6 +195,6 @@ def test_SaveDownloadedUnits_bad_checksum(self):
with self.assertRaises(exceptions.PulpCodedTaskFailedException) as ctx:
step.process_lifecycle()
self.assertEquals(
'Unable to sync repo1 from http://example.com/:'
'Unable to sync repo1 from http://example.com/dists/stable/:'
' mismatching checksums for file.deb: expected 00aa, actual AABB',
str(ctx.exception))
2 changes: 1 addition & 1 deletion pulp-deb.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%define inst_prefix pulp_deb

Name: pulp-deb
Version: 1.5.0
Version: 1.5.1
Release: 1%{?dist}
Summary: Support for Debian packages in the Pulp platform
Group: Development/Languages
Expand Down

0 comments on commit 58f086e

Please sign in to comment.