This fixed it for gojuju, but is untested for pyjuju:
=== modified file 'hooks/lib/openstack_common.py' --- hooks/lib/openstack_common.py 2013-03-21 18:25:39 +0000 +++ hooks/lib/openstack_common.py 2013-04-25 14:14:55 +0000 @@ -221,8 +221,8 @@ updated config information necessary to perform health checks or service changes. """ - unit_name = os.getenv('JUJU_UNIT_NAME').replace('/', '-') - juju_rc_path = "/var/lib/juju/units/%s/charm/%s" % (unit_name, script_path) + charm_dir = os.getenv('CHARM_DIR') + juju_rc_path = "%s/%s" % (charm_dir, script_path) with open(juju_rc_path, 'wb') as rc_script: rc_script.write( "#!/bin/bash\n")
This fixed it for gojuju, but is untested for pyjuju:
=== modified file 'hooks/ lib/openstack_ common. py' openstack_ common. py 2013-03-21 18:25:39 +0000 openstack_ common. py 2013-04-25 14:14:55 +0000 'JUJU_UNIT_ NAME'). replace( '/', '-') juju/units/ %s/charm/ %s" % (unit_name, script_path) 'CHARM_ DIR')
rc_script. write(
" #!/bin/ bash\n" )
--- hooks/lib/
+++ hooks/lib/
@@ -221,8 +221,8 @@
updated config information necessary to perform health checks or
service changes.
"""
- unit_name = os.getenv(
- juju_rc_path = "/var/lib/
+ charm_dir = os.getenv(
+ juju_rc_path = "%s/%s" % (charm_dir, script_path)
with open(juju_rc_path, 'wb') as rc_script: