Add controller-api and ovsdb relations

This commit is contained in:
Robert Ayres 2015-02-25 15:27:38 +00:00
parent 792f7b09af
commit 6067343d35
4 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1 @@
odl_controller_hooks.py

View File

@ -11,7 +11,8 @@ from charmhelpers.core.hookenv import (
Hooks,
UnregisteredHookError,
config,
log
log,
relation_set
)
from charmhelpers.core.host import (
@ -36,6 +37,10 @@ config = config()
def config_changed():
write_mvn_config()
@hooks.hook("controller-api-relation-joined")
def controller_api_joined():
relation_set(port=8080, username="admin", password="admin")
@hooks.hook()
def install():
# install dependencies
@ -68,6 +73,10 @@ def main():
except UnregisteredHookError as e:
log("Unknown hook {} - skipping.".format(e))
@hooks.hook("ovsdb-manager-relation-joined")
def ovsdb_manager_joined():
relation_set(port=6640, protocol="tcp")
@hooks.hook("upgrade-charm")
def upgrade_charm():
pass

View File

@ -0,0 +1 @@
odl_controller_hooks.py

View File

@ -8,3 +8,8 @@ description: |
This charm provides the controller component.
categories:
- openstack
provides:
controller-api:
interface: odl-controller-api
ovsdb-manager:
interface: ovsdb-manager