diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2013-07-31 15:22:54 +0000 |
---|---|---|
committer | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2013-07-31 16:41:40 +0000 |
commit | 95a4918a471ad1dc7110d3d64eb7e6a89dea34a5 (patch) | |
tree | cdfda88a8a7d0fab0ef8e16903f07aff85c7a90b /morphlib/app.py | |
parent | d15bbb2544d52ed53c344fa29c25e6928da3c55b (diff) | |
download | morph-95a4918a471ad1dc7110d3d64eb7e6a89dea34a5.tar.gz |
Set build-ref-prefix to be based on trove-id if the setting exists
Diffstat (limited to 'morphlib/app.py')
-rw-r--r-- | morphlib/app.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index b8f1eb1e..642dd241 100644 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -40,8 +40,7 @@ defaults = { 'ssh://git@github.com/%s'), ], 'cachedir': os.path.expanduser('~/.cache/morph'), - 'max-jobs': morphlib.util.make_concurrency(), - 'build-ref-prefix': 'baserock/builds' + 'max-jobs': morphlib.util.make_concurrency() } @@ -56,7 +55,7 @@ class Morph(cliapp.Application): self.settings.string(['build-ref-prefix'], 'Prefix to use for temporary build refs', metavar='PREFIX', - default=defaults['build-ref-prefix']) + default=None) self.settings.string(['trove-host'], 'hostname of Trove instance', metavar='TROVEHOST', @@ -200,6 +199,13 @@ class Morph(cliapp.Application): 'a system based on a version of Baserock older than ' 'Baserock 6.') + if self.settings['build-ref-prefix'] is None: + if self.settings['trove-id']: + self.settings['build-ref-prefix'] = os.path.join( + self.settings['trove-id'][0], 'builds') + else: + self.settings['build-ref-prefix'] = "baserock/builds" + # Combine the aliases into repo-alias before passing on to normal # command processing. This means everything from here on down can # treat settings['repo-alias'] as the sole source of prefixes for git |