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
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2013-12-07 21:35:28 +0000
+++ hooks/hooks.py 2014-01-02 19:56:07 +0000
@@ -163,6 +163,30 @@
163 os.unlink(os.path.join(_service_dir(config), 'amqp_config.py'))163 os.unlink(os.path.join(_service_dir(config), 'amqp_config.py'))
164164
165165
166def lander_jenkins_relation_joined(config):
167 host = subprocess.check_output(['unit-get', 'private-address']).strip()
168 _relation_set({
169 'lander_api_hostname': host,
170 })
171
172
173def lander_jenkins_relation_changed(config):
174 data = {
175 "lander_username": _relation_get('username'),
176 "lander_password": _relation_get('password'),
177 "lander_hostname": _relation_get('hostname'),
178 "lander_port": _relation_get('port'),
179 }
180 with open(os.path.join(_service_dir(config), 'lander_config.json'),
181 'w') as f:
182 f.write(json.dumps(data))
183 f.write('\n')
184
185
186def lander_jenkins_relation_broken(config):
187 os.unlink(os.path.join(_service_dir(config), 'lander_config.json'))
188
189
166def main():190def main():
167 hook = os.path.basename(sys.argv[0])191 hook = os.path.basename(sys.argv[0])
168 juju_info("Running hook: %s" % hook)192 juju_info("Running hook: %s" % hook)
169193
=== added symlink 'hooks/lander-jenkins-relation-broken'
=== target is u'hooks.py'
=== added symlink 'hooks/lander-jenkins-relation-changed'
=== target is u'hooks.py'
=== added symlink 'hooks/lander-jenkins-relation-joined'
=== target is u'hooks.py'
=== modified file 'metadata.yaml'
--- metadata.yaml 2013-12-07 22:13:24 +0000
+++ metadata.yaml 2014-01-02 19:56:07 +0000
@@ -16,3 +16,5 @@
16requires:16requires:
17 amqp:17 amqp:
18 interface: rabbitmq18 interface: rabbitmq
19 lander-jenkins:
20 interface: lander-jenkins

Subscribers

People subscribed via source and target branches

to all changes: