Merge lp:~ahasenack/charms/precise/keystone/use-charm-dir into lp:~openstack-charmers/charms/precise/keystone/ha-support

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 67
Proposed branch: lp:~ahasenack/charms/precise/keystone/use-charm-dir
Merge into: lp:~openstack-charmers/charms/precise/keystone/ha-support
Diff against target: 21 lines (+3/-3)
2 files modified
hooks/lib/openstack_common.py (+2/-2)
revision (+1/-1)
To merge this branch: bzr merge lp:~ahasenack/charms/precise/keystone/use-charm-dir
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+160956@code.launchpad.net

Commit message

Use CHARM_DIR instead of a hardcoded path for the charm directory. This makes the charm compatible with both juju and juju-core.

Description of the change

Use CHARM_DIR instead of a hardcoded path for the charm directory. This makes the charm compatible with both juju and juju-core.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/lib/openstack_common.py'
2--- hooks/lib/openstack_common.py 2013-03-21 18:25:39 +0000
3+++ hooks/lib/openstack_common.py 2013-04-25 17:00:39 +0000
4@@ -221,8 +221,8 @@
5 updated config information necessary to perform health checks or
6 service changes.
7 """
8- unit_name = os.getenv('JUJU_UNIT_NAME').replace('/', '-')
9- juju_rc_path = "/var/lib/juju/units/%s/charm/%s" % (unit_name, script_path)
10+ charm_dir = os.getenv('CHARM_DIR')
11+ juju_rc_path = "%s/%s" % (charm_dir, script_path)
12 with open(juju_rc_path, 'wb') as rc_script:
13 rc_script.write(
14 "#!/bin/bash\n")
15
16=== modified file 'revision'
17--- revision 2013-04-09 18:07:32 +0000
18+++ revision 2013-04-25 17:00:39 +0000
19@@ -1,1 +1,1 @@
20-218
21+219

Subscribers

People subscribed via source and target branches