From 2dfb8f876b2aa8a67138f44c947be9315142cc5e Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 30 Sep 2014 12:30:52 +0100 Subject: 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. --- morphlib/util.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'morphlib/util.py') 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), -- cgit v1.2.1