summaryrefslogtreecommitdiff
path: root/morphlib/buildcommand.py
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2014-10-27 17:15:55 +0000
committerSam Thursfield <sam@afuera.me.uk>2014-10-27 17:17:38 +0000
commita0c24350042082fe3e1195f8f6160da363c94843 (patch)
tree4db8e1be44b2d3106e33723fbe8c81777451ef5e /morphlib/buildcommand.py
parent71fbade1fdb5e0d578b9f0ec06d44b69951b8af8 (diff)
downloadmorph-a0c24350042082fe3e1195f8f6160da363c94843.tar.gz
Fix distbuild to allow passing a commit instead of a named ref to be built
The recent changes to the BuildCommand.build() function caused distbuild to break, because I didn't make the same change to the InitiatorBuildCommand.build() function but did change how it was called. This commit adds the ability to have optional fields in distbuild messages. This is used to add an optional 'original_ref' field, which will get passed to `morph serialise-artifact` by new distbuild controllers, and will be ignored by older ones.
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r--morphlib/buildcommand.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index 544d88d8..438badb3 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -542,21 +542,18 @@ class InitiatorBuildCommand(BuildCommand):
self.app.settings['push-build-branches'] = True
super(InitiatorBuildCommand, self).__init__(app)
- def build(self, args):
+ def build(self, repo_name, ref, filename, original_ref=None):
'''Initiate a distributed build on a controller'''
distbuild.add_crash_conditions(self.app.settings['crash-condition'])
- if len(args) != 3:
- raise morphlib.Error(
- 'Need repo, ref, morphology triplet to build')
-
if self.addr == '':
raise morphlib.Error(
'Need address of controller to run a distbuild')
self.app.status(msg='Starting distributed build')
loop = distbuild.MainLoop()
+ args = [repo_name, ref, filename, original_ref or ref]
cm = distbuild.InitiatorConnectionMachine(self.app,
self.addr,
self.port,