I changed the file charmhelpers/core/hookenv.py 's definition of relation_get to this and it worked (deployed and the service was working after the deploy):
def relation_get(attribute=None, unit=None, rid=None):
_args = ['relation-get', '--format=json']
if rid: _args.append('-r') _args.append(rid)
_args.append(attribute or '-')
if unit: _args.append(unit)
try:
return json.loads(subprocess.check_output(_args))
except ValueError:
return None
except subprocess.CalledProcessError as e: print(repr(e))
if e.returncode is 2:
return None
else:
raise e
I changed the file charmhelpers/ core/hookenv. py 's definition of relation_get to this and it worked (deployed and the service was working after the deploy):
def relation_ get(attribute= None, unit=None, rid=None):
_args. append( '-r')
_args. append( rid) append( attribute or '-')
_args. append( unit) subprocess. check_output( _args)) CalledProcessEr ror as e:
print( repr(e) )
_args = ['relation-get', '--format=json']
if rid:
_args.
if unit:
try:
return json.loads(
except ValueError:
return None
except subprocess.
if e.returncode is 2:
return None
else:
raise e