Initial commit

This commit is contained in:
Liam Young 2016-08-31 07:25:48 +00:00
commit bfd4279546
4 changed files with 36 additions and 0 deletions

0
__init__.py Normal file
View File

9
copyright Normal file
View File

@ -0,0 +1,9 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
Files: *
Copyright: 2015, Canonical Ltd.
License: GPL-3
License: GPL-3
On Debian GNU/Linux system you can find the complete text of the
GPL-3 license in '/usr/share/common-licenses/GPL-3'

3
interface.yaml Normal file
View File

@ -0,0 +1,3 @@
name: neutron-control
summary: Interface for requesting restarts of neutron services
maintainer: OpenStack Charmers <openstack-dev@lists.openstack.org>

24
provides.py Normal file
View File

@ -0,0 +1,24 @@
import uuid
from charms.reactive import hook
from charms.reactive import RelationBase
from charms.reactive import scopes
class NeutronControlProvides(RelationBase):
scope = scopes.GLOBAL
@hook('{provides:neutron-control}-relation-{joined,changed}')
def changed(self):
self.set_state('{relation_name}.connected')
@hook('{provides:neutron-control}-relation-{broken,departed}')
def broken(self):
self.remove_state('{relation_name}.connected')
def request_restart(self):
conversation = self.conversation()
relation_info = {
'restart-trigger': str(uuid.uuid4()),
}
conversation.set_remote(**relation_info)