Files
charm-interface-neutron-plugin/requires.py
Frode Nordahl adbfcb4ddd Add `host` attribute on requires side
Commit 6dca7338b2 added the attribute
on the wrong side of the interface.

Change-Id: I6d561617805280caebfe6e408d74ceaccefa1f08
Closes-Bug: #1845303
2019-10-02 06:25:23 +02:00

18 lines
496 B
Python

from charms.reactive import hook
from charms.reactive import RelationBase
from charms.reactive import scopes
class NeutronPluginRequires(RelationBase):
scope = scopes.GLOBAL
auto_accessors = ['host']
@hook('{requires:neutron-plugin}-relation-{joined,changed}')
def changed(self):
self.set_state('{relation_name}.connected')
@hook('{requires:neutron-plugin}-relation-{broken,departed}')
def broken(self):
self.remove_state('{relation_name}.connected')