Comment 1 for bug 1247636

Revision history for this message
Erik B. Andersen (azendale) wrote : Re: etherpad lite fails to deploy, install hook running get relation

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