diff --git a/hooks/keystone_hooks.py b/hooks/keystone_hooks.py index b6ab09c3..ab753f5a 100755 --- a/hooks/keystone_hooks.py +++ b/hooks/keystone_hooks.py @@ -240,6 +240,8 @@ def identity_changed(relation_id=None, remote_unit=None): ca_bundle = ca.get_ca_bundle() relation_data['https_keystone'] = 'True' relation_data['ca_cert'] = b64encode(ca_bundle) + if relation_id: + relation_data['rid'] = relation_id utils.relation_set(**relation_data) return diff --git a/hooks/lib/utils.py b/hooks/lib/utils.py index 1033a589..78e3d655 100644 --- a/hooks/lib/utils.py +++ b/hooks/lib/utils.py @@ -206,11 +206,9 @@ def relation_get_dict(relation_id=None, remote_unit=None): cmd.append('-r') cmd.append(relation_id) if remote_unit: - remote_unit_orig = os.getenv('JUJU_REMOTE_UNIT', None) - os.environ['JUJU_REMOTE_UNIT'] = remote_unit + cmd.append('-') + cmd.append(remote_unit) j = subprocess.check_output(cmd) - if remote_unit and remote_unit_orig: - os.environ['JUJU_REMOTE_UNIT'] = remote_unit_orig d = json.loads(j) settings = {} # convert unicode to strings diff --git a/revision b/revision index 7b473380..5f277ae7 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -221 +223