← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~nick-moffitt/launchpad/multippa into lp:launchpad

 

Nick Moffitt has proposed merging lp:~nick-moffitt/launchpad/multippa into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~nick-moffitt/launchpad/multippa/+merge/86223

This change uses urlparse to determine the name of a virtualized buildd that is to be reset.  This allows the buildmaster to pass this information down to the host during a reset operation, so that a given host may have multiple virtualized buildd guests.

This change allows changes in a config branch to enable this behavior, but should have no effect on the current production configuration.
-- 
https://code.launchpad.net/~nick-moffitt/launchpad/multippa/+merge/86223
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~nick-moffitt/launchpad/multippa into lp:launchpad.
=== modified file 'lib/lp/buildmaster/model/builder.py'
--- lib/lp/buildmaster/model/builder.py	2011-12-13 13:33:04 +0000
+++ lib/lp/buildmaster/model/builder.py	2011-12-19 11:55:26 +0000
@@ -20,6 +20,8 @@
 import tempfile
 import xmlrpclib
 
+from urlparse import urlparse
+
 from lazr.restful.utils import safe_hasattr
 from sqlobject import (
     BoolCol,
@@ -257,8 +259,11 @@
         :return: a Deferred that returns a
             (stdout, stderr, subprocess exitcode) triple
         """
+        url_components = urlparse(self.url)
+        buildd_name = url_components.hostname.split('.')[0]
         resume_command = config.builddmaster.vm_resume_command % {
-            'vm_host': self._vm_host}
+            'vm_host': self._vm_host,
+            'buildd_name': buildd_name}
         # Twisted API requires string but the configuration provides unicode.
         resume_argv = [
             term.encode('utf-8') for term in resume_command.split()]