Skip to content

Commit

Permalink
Changes needed to support relative url for ISO repositories
Browse files Browse the repository at this point in the history
The Q object used to find conflicts for relative url now restricts the search to distributor's of a
particular type. This is necesary to allow the same relative URLs for RPM and ISO content.

re: #2132
https://pulp.plan.io/issues/2132
  • Loading branch information
dkliban committed Sep 21, 2016
1 parent bd4f050 commit 0aa1352
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/pulp/plugins/conduits/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_repo_distributors_by_relative_url(self, rel_url, repo_id=None):
spec = rel_url_is_repo_id | rel_url_in_list | rel_url_match

if repo_id is not None:
spec = Q(repo_id__ne=repo_id) & spec
spec = Q(repo_id__ne=repo_id, distributor_type_id=self.distributor_type) & spec

dists = model.Distributor.objects(spec).only('repo_id', 'config')
return [{'repo_id': dist.repo_id, '_id': dist.id, 'config': dist.config} for dist in dists]
2 changes: 1 addition & 1 deletion server/pulp/plugins/rsync/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def get_master_directory(self):
:return: path to 'master' publish directory
:rtype: str
"""
repo_relative_path = self.predistributor['config']['relative_url']
repo_relative_path = self.predistributor['config'].get('relative_url', self.repo.id)
return os.path.realpath(os.path.join(self._get_root_publish_dir(), repo_relative_path))

def get_units_directory_dest_path(self):
Expand Down

0 comments on commit 0aa1352

Please sign in to comment.