Merge lp:~canonical-ci-engineering/charms/precise/ubuntu-ci-services-itself/restish-lander into lp:~canonical-ci-engineering/charms/precise/ubuntu-ci-services-itself/restish

Proposed by Francis Ginther
Status: Merged
Approved by: Francis Ginther
Approved revision: 17
Merged at revision: 14
Proposed branch: lp:~canonical-ci-engineering/charms/precise/ubuntu-ci-services-itself/restish-lander
Merge into: lp:~canonical-ci-engineering/charms/precise/ubuntu-ci-services-itself/restish
Diff against target: 50 lines (+26/-0)
2 files modified
hooks/hooks.py (+24/-0)
metadata.yaml (+2/-0)
To merge this branch: bzr merge lp:~canonical-ci-engineering/charms/precise/ubuntu-ci-services-itself/restish-lander
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Review via email: mp+200341@code.launchpad.net

Commit message

Add lander-jenkins relationship and interface.

Description of the change

Add lander-jenkins relationship and interface.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2013-12-07 21:35:28 +0000
3+++ hooks/hooks.py 2014-01-02 19:56:07 +0000
4@@ -163,6 +163,30 @@
5 os.unlink(os.path.join(_service_dir(config), 'amqp_config.py'))
6
7
8+def lander_jenkins_relation_joined(config):
9+ host = subprocess.check_output(['unit-get', 'private-address']).strip()
10+ _relation_set({
11+ 'lander_api_hostname': host,
12+ })
13+
14+
15+def lander_jenkins_relation_changed(config):
16+ data = {
17+ "lander_username": _relation_get('username'),
18+ "lander_password": _relation_get('password'),
19+ "lander_hostname": _relation_get('hostname'),
20+ "lander_port": _relation_get('port'),
21+ }
22+ with open(os.path.join(_service_dir(config), 'lander_config.json'),
23+ 'w') as f:
24+ f.write(json.dumps(data))
25+ f.write('\n')
26+
27+
28+def lander_jenkins_relation_broken(config):
29+ os.unlink(os.path.join(_service_dir(config), 'lander_config.json'))
30+
31+
32 def main():
33 hook = os.path.basename(sys.argv[0])
34 juju_info("Running hook: %s" % hook)
35
36=== added symlink 'hooks/lander-jenkins-relation-broken'
37=== target is u'hooks.py'
38=== added symlink 'hooks/lander-jenkins-relation-changed'
39=== target is u'hooks.py'
40=== added symlink 'hooks/lander-jenkins-relation-joined'
41=== target is u'hooks.py'
42=== modified file 'metadata.yaml'
43--- metadata.yaml 2013-12-07 22:13:24 +0000
44+++ metadata.yaml 2014-01-02 19:56:07 +0000
45@@ -16,3 +16,5 @@
46 requires:
47 amqp:
48 interface: rabbitmq
49+ lander-jenkins:
50+ interface: lander-jenkins

Subscribers

People subscribed via source and target branches

to all changes: