Fix up to work with 0.6.0 of charms.reactive
charms.reactive deprecates the RelationBase.from_state() class method. This is an internal method in charms.reactive and shouldn't really have been used. This patch changes to charms.relations.endpoint_from_flag(...) which essentially does the same thing and will be a more stable API moving forwards. Note that from this point on, the library will ONLY work with charms.reactive 0.6.0 onwards and the modified charms.openstack library. Change-Id: I0a9ddb5a8870cdf81a553229889f00090e90ab0b
This commit is contained in:
parent
edab27eaf2
commit
e779167bf5
|
@ -25,7 +25,7 @@ import charms_openstack.ip as os_ip
|
|||
import charmhelpers.core.decorators as decorators
|
||||
import charmhelpers.core.hookenv as hookenv
|
||||
import charmhelpers.core.host as host
|
||||
import charms.reactive as reactive
|
||||
import charms.reactive.relations as relations
|
||||
|
||||
from charmhelpers.contrib.network import ip as ch_ip
|
||||
|
||||
|
@ -539,9 +539,8 @@ class DesignateCharm(openstack_charm.HAOpenStackCharm):
|
|||
hookenv.config('neutron-domain'))):
|
||||
return 'blocked', ('nameservers must be set when specifying'
|
||||
' nova-domain or neutron-domain')
|
||||
dns_backend_available = (reactive
|
||||
.RelationBase
|
||||
.from_state('dns-backend.available'))
|
||||
dns_backend_available = (relations
|
||||
.endpoint_from_flag('dns-backend.available'))
|
||||
invalid_dns = self.options.invalid_pool_config()
|
||||
if invalid_dns:
|
||||
return 'blocked', invalid_dns
|
||||
|
|
|
@ -16,6 +16,7 @@ import subprocess
|
|||
|
||||
import charm.openstack.designate as designate
|
||||
import charms.reactive as reactive
|
||||
import charms.reactive.relations as relations
|
||||
import charmhelpers.core.hookenv as hookenv
|
||||
import charmhelpers.contrib.network.ip as ip
|
||||
|
||||
|
@ -123,10 +124,10 @@ def expose_rndc_address(cluster):
|
|||
def configure_designate_basic(*args):
|
||||
"""Configure the minimum to boostrap designate"""
|
||||
# If cluster relation is available it needs to passed in
|
||||
cluster = reactive.RelationBase.from_state('cluster.available')
|
||||
cluster = relations.endpoint_from_flag('cluster.available')
|
||||
if cluster is not None:
|
||||
args = args + (cluster, )
|
||||
dns_backend = reactive.RelationBase.from_state('dns-backend.available')
|
||||
dns_backend = relations.endpoint_from_flag('dns-backend.available')
|
||||
if dns_backend is not None:
|
||||
args = args + (dns_backend, )
|
||||
with provide_charm_instance() as instance:
|
||||
|
@ -159,10 +160,10 @@ def update_peers(cluster):
|
|||
def configure_designate_full(*args):
|
||||
"""Write out all designate config include bootstrap domain info"""
|
||||
# If cluster relation is available it needs to passed in
|
||||
cluster = reactive.RelationBase.from_state('cluster.available')
|
||||
cluster = relations.endpoint_from_flag('cluster.available')
|
||||
if cluster is not None:
|
||||
args = args + (cluster, )
|
||||
dns_backend = reactive.RelationBase.from_state('dns-backend.available')
|
||||
dns_backend = relations.endpoint_from_flag('dns-backend.available')
|
||||
if dns_backend is not None:
|
||||
args = args + (dns_backend, )
|
||||
with provide_charm_instance() as instance:
|
||||
|
|
Loading…
Reference in New Issue