From a205b610089826d9eae9498d3247ebfda79895e7 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Fri, 19 Jan 2018 14:34:51 +0000 Subject: [PATCH] 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: I282bf7fc864f9066596c20ba6175283e934e7c12 --- .gitignore | 1 + src/lib/charm/openstack/manila_generic.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a68c28d..a28e19e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ layers interfaces trusty .testrepository +.stestr __pycache__ diff --git a/src/lib/charm/openstack/manila_generic.py b/src/lib/charm/openstack/manila_generic.py index 8db5a54..65885b1 100644 --- a/src/lib/charm/openstack/manila_generic.py +++ b/src/lib/charm/openstack/manila_generic.py @@ -25,7 +25,7 @@ import charmhelpers.core.hookenv as hookenv import charmhelpers.core.templating import charms_openstack.charm import charms_openstack.adapters -import charms.reactive +import charms.reactive.relations as relations # There are no additional packages to install. PACKAGES = [] @@ -199,8 +199,7 @@ class ManilaGenericCharm(charms_openstack.charm.OpenStackCharm): # TODO this is horrible, and we should have something in # charms.openstack to do this, but we need a c.r relation to be able to # add it to the adapters_instance - manila_plugin = charms.reactive.RelationBase.from_state( - 'manila-plugin.available') + manila_plugin = relations.endpoint_from_flag('manila-plugin.available') self.adapters_instance.add_relation(manila_plugin) rendered_configs = charmhelpers.core.templating.render( source=os.path.basename(MANILA_CONF),