Skip to content

Commit

Permalink
Merge pull request pulp#2913 from dkliban/1976-rsync-changes
Browse files Browse the repository at this point in the history
Problem: RSyncFastForwardUnitPublishStep publishes incorrectly
  • Loading branch information
dkliban authored Jan 16, 2017
2 parents b0f8dd7 + 97259ea commit 98b38d1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions server/pulp/plugins/util/publish_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,11 +1307,17 @@ def process_main(self, item=None):
storage_dir = os.path.join(pulp_config.get('server', 'storage_dir'), 'content', 'units')
relative_content_unit_path = os.path.relpath(item.storage_path, storage_dir)
self.parent.content_unit_file_list.append(relative_content_unit_path)
filename = item.get_symlink_name()
if self.published_unit_path:
filename = item.get_symlink_name()
published_unit_path = self.published_unit_path
else:
dirname, filename = os.path.split(item.get_symlink_name())
published_unit_path = dirname.split('/')

symlink = self.make_link_unit(item, filename, self.get_working_dir(),
self.remote_repo_path,
self.get_config().get("remote")["root"],
self.published_unit_path)
published_unit_path)
self.parent.symlink_list.append(symlink)

def make_link_unit(self, unit, filename, working_dir, remote_repo_path, remote_root,
Expand Down Expand Up @@ -1353,7 +1359,9 @@ def make_link_unit(self, unit, filename, working_dir, remote_repo_path, remote_r
if os.path.islink(dest):
os.remove(dest)
os.symlink(link_source, dest)
return os.path.join(*(published_unit_path + [filename]))
if self.published_unit_path:
return os.path.join(*(published_unit_path + [filename]))
return unit.get_symlink_name()

def get_origin_rel_path(self, unit):
"""
Expand Down

0 comments on commit 98b38d1

Please sign in to comment.