Merge lp:~gmb/charms/oneiric/buildbot-master/2012-02-07 into lp:~yellow/charms/oneiric/buildbot-master/trunk

Proposed by Graham Binns
Status: Merged
Approved by: Francesco Banconi
Approved revision: 14
Merged at revision: 15
Proposed branch: lp:~gmb/charms/oneiric/buildbot-master/2012-02-07
Merge into: lp:~yellow/charms/oneiric/buildbot-master/trunk
Diff against target: 68 lines (+9/-6)
3 files modified
hooks/buildbot-relation-changed (+4/-3)
hooks/config-changed (+5/-1)
hooks/install (+0/-2)
To merge this branch: bzr merge lp:~gmb/charms/oneiric/buildbot-master/2012-02-07
Reviewer Review Type Date Requested Status
Francesco Banconi Approve
Review via email: mp+91888@code.launchpad.net

Description of the change

Changes from gmb and frankban for 2012-02-07
============================================

 - slave_info.json is now only updated if there are builders; this allows us to work around the fact that buildbot-relation-changed is called twice, once without builders, once with.
 - hooks/config-changed now handles extra-packages properly.
 - hooks/config-changed now initialises slave_info.json if it doesn't exist.
 - Removed some cruft from hooks/install.

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :

Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/buildbot-relation-changed'
2--- hooks/buildbot-relation-changed 2012-02-07 13:29:08 +0000
3+++ hooks/buildbot-relation-changed 2012-02-07 17:36:18 +0000
4@@ -39,9 +39,10 @@
5 log("builders: {}".format(builders))
6 name = get_or_create('name', prefix='slave-')
7 passwd = get_or_create('passwd')
8- update_slave_json(builders, name, passwd)
9- log("Reconfiguring buildbot.")
10- buildbot_reconfig()
11+ if builders:
12+ update_slave_json(builders, name, passwd)
13+ log("Reconfiguring buildbot.")
14+ buildbot_reconfig()
15 log("Sending name and password to the slave.")
16 relation_set(name=name, passwd=passwd)
17
18
19=== modified file 'hooks/config-changed'
20--- hooks/config-changed 2012-02-07 13:29:08 +0000
21+++ hooks/config-changed 2012-02-07 17:36:18 +0000
22@@ -25,6 +25,7 @@
23 buildbot_reconfig,
24 config_json,
25 generate_string,
26+ slave_json,
27 )
28
29 REQUIRED_KEYS = [
30@@ -67,7 +68,7 @@
31 if extra_repo and 'extra-repository' in added_or_changed:
32 install_extra_repository(extra_repo)
33 restart_required = True
34- if extra_pkgs and 'extra_packages' in added_or_changed:
35+ if extra_pkgs and 'extra-packages' in added_or_changed:
36 apt_get_install(
37 *(pkg.strip() for pkg in extra_pkgs.split()))
38 restart_required = True
39@@ -128,6 +129,9 @@
40 shutil.move(master_cfg_path, master_cfg_path + '.original')
41 shutil.copy(
42 os.path.join(os.path.dirname(__file__), 'master.cfg'), master_cfg_path)
43+ # Initialise the slave JSON if it doesn't exist.
44+ if not slave_json.exists():
45+ slave_json.set({})
46 placeholder_path = os.path.join(buildbot_dir, 'placeholder.json')
47 if not os.path.exists(placeholder_path):
48 with open(placeholder_path, 'w') as f:
49
50=== modified file 'hooks/install'
51--- hooks/install 2012-02-07 13:29:08 +0000
52+++ hooks/install 2012-02-07 17:36:18 +0000
53@@ -15,7 +15,6 @@
54 )
55 from local import (
56 config_json,
57- slave_json,
58 )
59
60
61@@ -35,7 +34,6 @@
62 # Initialize the cached config so that old configs don't hang around
63 # after the service is torn down.
64 config_json.set({})
65- slave_json.set({})
66
67
68 def main():

Subscribers

People subscribed via source and target branches

to all changes: