Initial commit
This commit is contained in:
commit
bfd4279546
0
__init__.py
Normal file
0
__init__.py
Normal file
9
copyright
Normal file
9
copyright
Normal 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
3
interface.yaml
Normal 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
24
provides.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user