Support hacluster using peer-availability relation

Add support for the hacluster charm to be related to a principle
using the juju-info interface using the peer-availability relation.
This is useful in the situation where a cluster without any resources
is needed.

Change-Id: Ibd03ba7923cfd2c412d5f772cf385a21c423e5af
This commit is contained in:
Liam Young 2019-03-01 11:13:05 +00:00
parent 02b406b6f3
commit bca864f33f
4 changed files with 8 additions and 1 deletions

View File

@ -229,6 +229,8 @@ def hanode_relation_joined(relid=None):
@hooks.hook('ha-relation-joined',
'ha-relation-changed',
'peer-availability-relation-joined',
'peer-availability-relation-changed',
'hanode-relation-changed')
def ha_relation_changed():
# Check that we are related to a principle and that
@ -253,7 +255,7 @@ def ha_relation_changed():
level=INFO)
return
relids = relation_ids('ha')
relids = relation_ids('ha') or relation_ids('juju-info')
if len(relids) == 1: # Should only ever be one of these
# Obtain relation information
relid = relids[0]

View File

@ -0,0 +1 @@
hooks.py

View File

@ -0,0 +1 @@
hooks.py

View File

@ -15,6 +15,9 @@ requires:
juju-info:
interface: juju-info
scope: container
peer-availability:
interface: juju-info
scope: container
provides:
ha:
interface: hacluster