Fixes for compat with juju-core
This commit is contained in:
@@ -240,6 +240,8 @@ def identity_changed(relation_id=None, remote_unit=None):
|
|||||||
ca_bundle = ca.get_ca_bundle()
|
ca_bundle = ca.get_ca_bundle()
|
||||||
relation_data['https_keystone'] = 'True'
|
relation_data['https_keystone'] = 'True'
|
||||||
relation_data['ca_cert'] = b64encode(ca_bundle)
|
relation_data['ca_cert'] = b64encode(ca_bundle)
|
||||||
|
if relation_id:
|
||||||
|
relation_data['rid'] = relation_id
|
||||||
utils.relation_set(**relation_data)
|
utils.relation_set(**relation_data)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@@ -206,11 +206,9 @@ def relation_get_dict(relation_id=None, remote_unit=None):
|
|||||||
cmd.append('-r')
|
cmd.append('-r')
|
||||||
cmd.append(relation_id)
|
cmd.append(relation_id)
|
||||||
if remote_unit:
|
if remote_unit:
|
||||||
remote_unit_orig = os.getenv('JUJU_REMOTE_UNIT', None)
|
cmd.append('-')
|
||||||
os.environ['JUJU_REMOTE_UNIT'] = remote_unit
|
cmd.append(remote_unit)
|
||||||
j = subprocess.check_output(cmd)
|
j = subprocess.check_output(cmd)
|
||||||
if remote_unit and remote_unit_orig:
|
|
||||||
os.environ['JUJU_REMOTE_UNIT'] = remote_unit_orig
|
|
||||||
d = json.loads(j)
|
d = json.loads(j)
|
||||||
settings = {}
|
settings = {}
|
||||||
# convert unicode to strings
|
# convert unicode to strings
|
||||||
|
Reference in New Issue
Block a user