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:
parent
02b406b6f3
commit
bca864f33f
@ -229,6 +229,8 @@ def hanode_relation_joined(relid=None):
|
|||||||
|
|
||||||
@hooks.hook('ha-relation-joined',
|
@hooks.hook('ha-relation-joined',
|
||||||
'ha-relation-changed',
|
'ha-relation-changed',
|
||||||
|
'peer-availability-relation-joined',
|
||||||
|
'peer-availability-relation-changed',
|
||||||
'hanode-relation-changed')
|
'hanode-relation-changed')
|
||||||
def ha_relation_changed():
|
def ha_relation_changed():
|
||||||
# Check that we are related to a principle and that
|
# Check that we are related to a principle and that
|
||||||
@ -253,7 +255,7 @@ def ha_relation_changed():
|
|||||||
level=INFO)
|
level=INFO)
|
||||||
return
|
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
|
if len(relids) == 1: # Should only ever be one of these
|
||||||
# Obtain relation information
|
# Obtain relation information
|
||||||
relid = relids[0]
|
relid = relids[0]
|
||||||
|
1
hooks/peer-availability-relation-changed
Symbolic link
1
hooks/peer-availability-relation-changed
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
hooks.py
|
1
hooks/peer-availability-relation-joined
Symbolic link
1
hooks/peer-availability-relation-joined
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
hooks.py
|
@ -15,6 +15,9 @@ requires:
|
|||||||
juju-info:
|
juju-info:
|
||||||
interface: juju-info
|
interface: juju-info
|
||||||
scope: container
|
scope: container
|
||||||
|
peer-availability:
|
||||||
|
interface: juju-info
|
||||||
|
scope: container
|
||||||
provides:
|
provides:
|
||||||
ha:
|
ha:
|
||||||
interface: hacluster
|
interface: hacluster
|
||||||
|
Loading…
Reference in New Issue
Block a user