summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-07 15:04:59 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-07 15:04:59 +0100
commitd3be16e282bfdf7a8db8538339719161725b5cad (patch)
tree48744548262d02a81a6dbca1e83a2d876f4c4485
parent53e1b30f654d05a26a999a0ad7b8ff9c1895aef6 (diff)
parent2dfb8f876b2aa8a67138f44c947be9315142cc5e (diff)
downloadmorph-d3be16e282bfdf7a8db8538339719161725b5cad.tar.gz
Merge branch 'sam/gbo-read-access'
Reviewed-By: Pedro Alvarez <pedro.alvarez@codethink.co.uk> Reviewed-By: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>
-rw-r--r--morphlib/util.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/morphlib/util.py b/morphlib/util.py
index dc3dd474..cc8ce88d 100644
--- a/morphlib/util.py
+++ b/morphlib/util.py
@@ -142,7 +142,18 @@ def new_artifact_caches(settings): # pragma: no cover
def combine_aliases(app): # pragma: no cover
- '''Create a full repo-alias set from the app's settings.'''
+ '''Create a full repo-alias set from the app's settings.
+
+ The standard 'baserock:' and 'upstream:' keyed URLs use whatever trove was
+ set as 'trove-host'.
+
+ Every trove listed in 'trove-ids' has its own repo-alias created in
+ addition to the defaults. We assume these require authenticated access, so
+ the keyed URL expansions for these troves are ssh:// URLs for both read and
+ write access. This can be overridden by the user if they calculate the full
+ repo-alias string and set it in their config manually.
+
+ '''
trove_host = app.settings['trove-host']
trove_ids = app.settings['trove-id']
repo_aliases = app.settings['repo-alias']
@@ -173,7 +184,7 @@ def combine_aliases(app): # pragma: no cover
m.group('prefix'),
_expand(m.group('pull'), m.group('path')),
_expand(m.group('push'), m.group('path')))
- elif '=' not in trove_id:
+ elif '=' not in trove_id and trove_id not in alias_map:
alias_map[trove_id] = "%s=%s#%s" % (
trove_id,
_expand('ssh', trove_id),