From 55de68b794d717f711c008dd3efecdba6864a6d9 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 17 Jun 2014 16:14:17 +0100 Subject: [PATCH] Add support for neutron-plugin-api relation and switch to using that for security group settings --- hooks/neutron-plugin-api-relation-broken | 1 + hooks/neutron-plugin-api-relation-changed | 1 + hooks/neutron-plugin-api-relation-departed | 1 + hooks/neutron-plugin-api-relation-joined | 1 + hooks/neutron_ovs_context.py | 6 ++++-- metadata.yaml | 3 ++- 6 files changed, 10 insertions(+), 3 deletions(-) create mode 120000 hooks/neutron-plugin-api-relation-broken create mode 120000 hooks/neutron-plugin-api-relation-changed create mode 120000 hooks/neutron-plugin-api-relation-departed create mode 120000 hooks/neutron-plugin-api-relation-joined diff --git a/hooks/neutron-plugin-api-relation-broken b/hooks/neutron-plugin-api-relation-broken new file mode 120000 index 00000000..55aa8e52 --- /dev/null +++ b/hooks/neutron-plugin-api-relation-broken @@ -0,0 +1 @@ +neutron_ovs_hooks.py \ No newline at end of file diff --git a/hooks/neutron-plugin-api-relation-changed b/hooks/neutron-plugin-api-relation-changed new file mode 120000 index 00000000..55aa8e52 --- /dev/null +++ b/hooks/neutron-plugin-api-relation-changed @@ -0,0 +1 @@ +neutron_ovs_hooks.py \ No newline at end of file diff --git a/hooks/neutron-plugin-api-relation-departed b/hooks/neutron-plugin-api-relation-departed new file mode 120000 index 00000000..55aa8e52 --- /dev/null +++ b/hooks/neutron-plugin-api-relation-departed @@ -0,0 +1 @@ +neutron_ovs_hooks.py \ No newline at end of file diff --git a/hooks/neutron-plugin-api-relation-joined b/hooks/neutron-plugin-api-relation-joined new file mode 120000 index 00000000..55aa8e52 --- /dev/null +++ b/hooks/neutron-plugin-api-relation-joined @@ -0,0 +1 @@ +neutron_ovs_hooks.py \ No newline at end of file diff --git a/hooks/neutron_ovs_context.py b/hooks/neutron_ovs_context.py index ebd6c227..c3d4b6bc 100644 --- a/hooks/neutron_ovs_context.py +++ b/hooks/neutron_ovs_context.py @@ -17,9 +17,11 @@ def _neutron_security_groups(): Inspects current neutron-plugin relation and determine if nova-c-c has instructed us to use neutron security groups. ''' - for rid in relation_ids('neutron-plugin'): + for rid in relation_ids('neutron-plugin-api'): for unit in related_units(rid): - return relation_get('neutron_security_groups',rid=rid, unit=unit) + sec_group=relation_get('neutron_security_groups',rid=rid, unit=unit) + if sec_group is not None: + return sec_group return False class OVSPluginContext(context.NeutronContext): diff --git a/metadata.yaml b/metadata.yaml index 69a365b2..7a5f2d26 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -16,4 +16,5 @@ requires: container: interface: juju-info scope: container - + neutron-plugin-api: + interface: neutron-plugin-api