Bug 806740

Summary: Add separate "latest_link" entry to remote tree configuration
Product: [Community] PulpDist Reporter: Nick Coghlan <ncoghlan>
Component: z_otherAssignee: Nick Coghlan <ncoghlan>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: unspecifiedKeywords: Reopened
Target Milestone: 0.1.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-26 23:51:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Nick Coghlan 2012-03-26 06:39:13 UTC
PulpDist 0.0.7 uses the "listing_prefix" to determine both the directories to be retrieved from the upstream server *and* the name to be used for the symlink to the latest version for snapshot trees (calculated as "latest-<listing_prefix>").

It is not always desirable that these two values be the same, so a separate "latest_link" setting should be supported that allows the name used for the symlink to be specified explicitly (with the "latest-<listing_prefix>" behaviour being retained as a default).

Comment 1 Nick Coghlan 2012-03-26 07:26:26 UTC
On further reflection, these rare cases where the name differs between the source and local copy can be handled by creating a local unchanging symlink to the symlink that is dynamically updated by the PulpDist plugin.

Comment 2 Nick Coghlan 2012-03-26 07:45:29 UTC
Further investigation has now shown that the listing_prefix/suffix concept simply doesn't map properly to the intended use cases.

These attributes will be dropped in favour of the more general "listing_pattern" option, with a new "latest_link" attribute added to handle the correct naming of the symlink created to refer to the most recently synchronised directory for snapshot trees.

Comment 3 Nick Coghlan 2012-03-26 07:51:52 UTC
And now we come full circle: the listing prefix/suffix concept actually does cover the desired use cases, *as long as* the prefix is allowed to be a full rsync wildcard pattern.

That is not currently the case, since the prefix is *also* used to define the filename for the latest link, which obviously doesn't work if the prefix contains wildcard characters. The simplest solution is therefore to require that the latest link name be specified explicitly (allowing None to be passed to request that creation of the symbolic link be omitted entirely).

Comment 4 Nick Coghlan 2012-03-26 23:51:33 UTC
Fixed in 0.0.8 by allowing rsync wildcards in listing_prefix and adding a new latest_link attribute for remote trees (defaulting to None).

When deriving a repo config from a mirror config, latest_link_name is set only if the latest_link attribute is set to something other than none.