← Back to team overview

yellow team mailing list archive

[Merge] lp:~frankban/charms/oneiric/buildbot-master/02-14-tests into lp:~yellow/charms/oneiric/buildbot-master/trunk

 

Francesco Banconi has proposed merging lp:~frankban/charms/oneiric/buildbot-master/02-14-tests into lp:~yellow/charms/oneiric/buildbot-master/trunk.

Requested reviews:
  Launchpad Yellow Squad (yellow)

For more details, see:
https://code.launchpad.net/~frankban/charms/oneiric/buildbot-master/02-14-tests/+merge/93032

*Changes from frankban and gmb*:

The `cleanup` function in the install hook now stops (if running) buildbot using the installdir previously stored in the config JSON file.

*Tests*:

$ RESOLVE_TEST_CHARMS=1 tests/buildbot-master.test -v
test_lpbuildbot (__main__.TestCharm) ... ok
test_port_opened (__main__.TestCharm) ... ok

----------------------------------------------------------------------
Ran 2 tests in 358.658s

OK

-- 
https://code.launchpad.net/~frankban/charms/oneiric/buildbot-master/02-14-tests/+merge/93032
Your team Launchpad Yellow Squad is requested to review the proposed merge of lp:~frankban/charms/oneiric/buildbot-master/02-14-tests into lp:~yellow/charms/oneiric/buildbot-master/trunk.
=== modified file 'hooks/config-changed'
--- hooks/config-changed	2012-02-14 11:53:08 +0000
+++ hooks/config-changed	2012-02-14 17:23:23 +0000
@@ -7,7 +7,6 @@
 import os
 import os.path
 import shutil
-import StringIO
 import sys
 
 from helpers import (

=== modified file 'hooks/install'
--- hooks/install	2012-02-14 11:45:55 +0000
+++ hooks/install	2012-02-14 17:23:23 +0000
@@ -21,7 +21,7 @@
     )
 
 
-def bootstrap(buildbot_dir):
+def cleanup(buildbot_dir):
     apt_get_install('bzr')
     # Since we may be installing into a pre-existing service, ensure the
     # buildbot directory is removed.
@@ -30,8 +30,8 @@
             run('buildbot', 'stop', buildbot_dir)
         except (CalledProcessError, OSError):
             # This usually happens because buildbot hasn't been
-            # installed yet, or that it wasn't running; just ignore the
-            # error.
+            # installed yet, or that it wasn't running; just
+            # ignore the error.
             pass
         shutil.rmtree(buildbot_dir)
     # Initialize the cached config so that old configs don't hang around
@@ -46,7 +46,9 @@
     config = get_config()
     log("config:")
     log(str(config))
-    bootstrap(config['installdir'])
+    old_config = config_json.get()
+    buildbot_dir = old_config.get('installdir', config['installdir'])
+    cleanup(buildbot_dir)
 
 
 if __name__ == '__main__':


Follow ups