From e8e2c38042ec101e2323b1035f0f85c2a53fa07b Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 14 Jan 2019 17:23:16 +0000 Subject: [PATCH] Add 'stateless' flag support --- provides.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/provides.py b/provides.py index fff78f3..2d81551 100644 --- a/provides.py +++ b/provides.py @@ -26,8 +26,17 @@ class CinderBackendProvides(RelationBase): self.remove_state('{relation_name}.connected') conv.set_state('{relation_name}.departing') - def configure_principal(self, backend_name, configuration): - """Send principle cinder-backend information""" + def configure_principal(self, backend_name, configuration, stateless=None): + """Send principle cinder-backend information. + + :param backend_name: Name of storage backend. + :type backend_name: str + :param configuration: List of pairs of key value tuples to be used in + backend section of config. + :type configuration: [(k1,v1), (k2,v2),...] + :param stateless: Whether backend is stateless. + :type stateless: bool + """ conv = self.conversation() subordinate_configuration = { @@ -39,6 +48,6 @@ class CinderBackendProvides(RelationBase): } } } - - conv.set_remote(backend_name=backend_name + conv.set_remote(backend_name=backend_name, + stateless=stateless, subordinate_configuration=configuration)