Tidy up and fix bug causing sec group settings to not be updated by api service

This commit is contained in:
Liam Young 2014-06-23 13:50:23 +01:00
parent b5b11f8c87
commit d3fc9a8516
5 changed files with 11 additions and 4 deletions

View File

@ -20,7 +20,7 @@ def _neutron_security_groups():
''' '''
for rid in relation_ids('neutron-plugin-api'): for rid in relation_ids('neutron-plugin-api'):
for unit in related_units(rid): for unit in related_units(rid):
sec_group = relation_get('neutron_security_groups', sec_group = relation_get('neutron-security-groups',
rid=rid, rid=rid,
unit=unit) unit=unit)
if sec_group is not None: if sec_group is not None:
@ -62,7 +62,7 @@ class OVSPluginContext(context.NeutronContext):
ovs_ctxt['local_ip'] = get_host_ip(unit_get('private-address')) ovs_ctxt['local_ip'] = get_host_ip(unit_get('private-address'))
ovs_ctxt['neutron_security_groups'] = self.neutron_security_groups ovs_ctxt['neutron_security_groups'] = self.neutron_security_groups
# TODO: We need to sort out the syslog and debug/verbose options as a # TODO: We need to sort out the syslog and debug/verbose options as a
# general context helper # general context helper
ovs_ctxt['use_syslog'] = conf['use-syslog'] ovs_ctxt['use_syslog'] = conf['use-syslog']
ovs_ctxt['verbose'] = conf['verbose'] ovs_ctxt['verbose'] = conf['verbose']
ovs_ctxt['debug'] = conf['debug'] ovs_ctxt['debug'] = conf['debug']

View File

@ -29,7 +29,12 @@ TEMPLATES = 'templates/'
def determine_packages(): def determine_packages():
return set(neutron_plugin_attribute('ovs', 'packages', 'neutron')) ovs_pkgs = []
pkgs = neutron_plugin_attribute('ovs', 'packages',
'neutron')
for pkg in pkgs:
ovs_pkgs.extend(pkg)
return set(ovs_pkgs)
def register_configs(release=None): def register_configs(release=None):

1
hooks/start Symbolic link
View File

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

1
hooks/stop Symbolic link
View File

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

View File

@ -53,7 +53,7 @@ class OVSPluginContextTest(CharmTestCase):
_is_clus.return_value = False _is_clus.return_value = False
self.related_units.return_value = ['unit1'] self.related_units.return_value = ['unit1']
self.relation_ids.return_value = ['rid2'] self.relation_ids.return_value = ['rid2']
self.test_relation.set({'neutron_security_groups': 'yes'}) self.test_relation.set({'neutron-security-groups': 'yes'})
self.get_host_ip.return_value = '127.0.0.15' self.get_host_ip.return_value = '127.0.0.15'
self.service_running.return_value = False self.service_running.return_value = False
napi_ctxt = context.OVSPluginContext() napi_ctxt = context.OVSPluginContext()