summaryrefslogtreecommitdiff
path: root/morphlib/util.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-09-30 12:30:52 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-07 14:56:30 +0100
commit2dfb8f876b2aa8a67138f44c947be9315142cc5e (patch)
tree3dcfc0391317c26698732590de04357f300a2d6b /morphlib/util.py
parentc754d0366d4557910775bfa83c85ffdf98af0610 (diff)
downloadmorph-2dfb8f876b2aa8a67138f44c947be9315142cc5e.tar.gz
Never require SSH access to the Trove where baserock: content is hosted
Previously if the user included 'baserock' in their list of trove-ids, the keyed URL expansions in the repo-alias field would change such that reading from git.baserock.org required SSH access. This isn't good and in particular breaks Mason, which by default isn't set up with a Gitano account on the Trove that it reads from, and therefore doesn't have SSH access to that Trove. With this change, the trove-id field will not cause the default 'baserock:' and 'upstream:' prefixes to be overridden, so setting 'trove-id = baserock' in morph.conf will not Morph's behaviour to change.
Diffstat (limited to 'morphlib/util.py')
-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),