summaryrefslogtreecommitdiff
path: root/distbuild/initiator.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 /distbuild/initiator.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 'distbuild/initiator.py')
-rw-r--r--distbuild/initiator.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/distbuild/initiator.py b/distbuild/initiator.py
index b0993aa3..70b26c1e 100644
--- a/distbuild/initiator.py
+++ b/distbuild/initiator.py
@@ -39,7 +39,7 @@ class _Failed(object):
class Initiator(distbuild.StateMachine):
- def __init__(self, cm, conn, app, repo_name, ref, morphology):
+ def __init__(self, cm, conn, app, repo_name, ref, morphology, original_ref):
distbuild.StateMachine.__init__(self, 'waiting')
self._cm = cm
self._conn = conn
@@ -47,6 +47,7 @@ class Initiator(distbuild.StateMachine):
self._repo_name = repo_name
self._ref = ref
self._morphology = morphology
+ self._original_ref = original_ref
self._steps = None
self._step_outputs = {}
self._step_output_dir = app.settings['initiator-step-output-dir']
@@ -80,7 +81,8 @@ class Initiator(distbuild.StateMachine):
id=random_id,
repo=self._repo_name,
ref=self._ref,
- morphology=self._morphology
+ morphology=self._morphology,
+ original_ref=self._original_ref
)
self._jm.send(msg)
logging.debug('Initiator: sent to controller: %s', repr(msg))