Replace deprecated eligible_leader with is_elected_leader

This commit is contained in:
Liam Young
2015-03-09 16:15:42 +00:00
parent 7ace28c310
commit fbf77194b4
2 changed files with 5 additions and 5 deletions

View File

@@ -62,7 +62,7 @@ from charmhelpers.contrib.storage.linux.ceph import (
)
from charmhelpers.contrib.hahelpers.cluster import (
eligible_leader,
is_elected_leader,
get_hacluster_config,
)
@@ -175,7 +175,7 @@ def db_changed():
juju_log('shared-db relation incomplete. Peer not ready?')
return
CONFIGS.write(CINDER_CONF)
if eligible_leader(CLUSTER_RES):
if is_elected_leader(CLUSTER_RES):
# Bugs 1353135 & 1187508. Dbs can appear to be ready before the units
# acl entry has been added. So, if the db supports passing a list of
# permitted units then check if we're in the list.
@@ -194,7 +194,7 @@ def pgsql_db_changed():
juju_log('pgsql-db relation incomplete. Peer not ready?')
return
CONFIGS.write(CINDER_CONF)
if eligible_leader(CLUSTER_RES):
if is_elected_leader(CLUSTER_RES):
juju_log('Cluster leader, performing db sync')
migrate_database()

View File

@@ -29,7 +29,7 @@ from charmhelpers.core.host import (
from charmhelpers.contrib.openstack.alternatives import install_alternative
from charmhelpers.contrib.hahelpers.cluster import (
eligible_leader,
is_elected_leader,
)
from charmhelpers.contrib.storage.linux.utils import (
@@ -445,7 +445,7 @@ def do_openstack_upgrade(configs):
# Stop/start services and migrate DB if leader
[service_stop(s) for s in services()]
if eligible_leader(CLUSTER_RES):
if is_elected_leader(CLUSTER_RES):
migrate_database()
[service_start(s) for s in services()]