Merge lp:~bac/charms/oneiric/buildbot-slave/bbs into lp:~yellow/charms/oneiric/buildbot-slave/trunk

Proposed by Brad Crittenden
Status: Merged
Approved by: Gary Poster
Approved revision: 9
Merge reported by: Brad Crittenden
Merged at revision: not available
Proposed branch: lp:~bac/charms/oneiric/buildbot-slave/bbs
Merge into: lp:~yellow/charms/oneiric/buildbot-slave/trunk
Diff against target: 103 lines (+29/-8)
4 files modified
hooks/buildbot-relation-changed (+8/-2)
hooks/buildbot-relation-joined (+7/-2)
hooks/config-changed (+7/-2)
hooks/install (+7/-2)
To merge this branch: bzr merge lp:~bac/charms/oneiric/buildbot-slave/bbs
Reviewer Review Type Date Requested Status
Gary Poster (community) Approve
Yellow Squad code Pending
Review via email: mp+92130@code.launchpad.net

Description of the change

Standardize calling of main and logging entry/exit.

Add some more log output.

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) :
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 12:33:51 +0000
3+++ hooks/buildbot-relation-changed 2012-02-08 20:30:27 +0000
4@@ -8,6 +8,8 @@
5 from helpers import (
6 get_config,
7 log,
8+ log_entry,
9+ log_exit,
10 relation_get,
11 )
12 from local import (
13@@ -30,6 +32,7 @@
14 def main():
15 name = relation_get('name')
16 passwd = relation_get('passwd')
17+ log("name {} password {}".format(name, passwd))
18 if name and passwd:
19 # We heard back from the master and we are ready to start.
20 config = get_config()
21@@ -39,5 +42,8 @@
22
23
24 if __name__ == '__main__':
25- log('BUILDBOT-RELATION-CHANGED HOOK:')
26- main()
27+ log_entry()
28+ try:
29+ main()
30+ finally:
31+ log_exit()
32
33=== modified file 'hooks/buildbot-relation-joined'
34--- hooks/buildbot-relation-joined 2012-02-07 12:33:51 +0000
35+++ hooks/buildbot-relation-joined 2012-02-08 20:30:27 +0000
36@@ -6,6 +6,8 @@
37 from helpers import (
38 get_config,
39 log,
40+ log_entry,
41+ log_exit,
42 relation_set,
43 )
44
45@@ -24,5 +26,8 @@
46
47
48 if __name__ == '__main__':
49- log('BUILDBOT-RELATION-JOINED HOOK:')
50- main()
51+ log_entry()
52+ try:
53+ main()
54+ finally:
55+ log_exit()
56
57=== modified file 'hooks/config-changed'
58--- hooks/config-changed 2012-02-07 15:55:26 +0000
59+++ hooks/config-changed 2012-02-08 20:30:27 +0000
60@@ -9,6 +9,8 @@
61 get_config,
62 install_extra_repository,
63 log,
64+ log_entry,
65+ log_exit,
66 )
67 from local import (
68 config_json,
69@@ -42,5 +44,8 @@
70
71
72 if __name__ == '__main__':
73- log('CONFIG-CHANGED HOOK:')
74- main()
75+ log_entry()
76+ try:
77+ main()
78+ finally:
79+ log_exit()
80
81=== modified file 'hooks/install'
82--- hooks/install 2012-02-07 15:55:26 +0000
83+++ hooks/install 2012-02-08 20:30:27 +0000
84@@ -8,6 +8,8 @@
85 command,
86 get_config,
87 log,
88+ log_entry,
89+ log_exit,
90 )
91 import os
92 import shlex
93@@ -85,5 +87,8 @@
94
95
96 if __name__ == '__main__':
97- log('INSTALL HOOK:')
98- main()
99+ log_entry()
100+ try:
101+ main()
102+ finally:
103+ log_exit()

Subscribers

People subscribed via source and target branches

to all changes: