Lint and tipdyup

This commit is contained in:
Liam Young 2015-06-29 13:21:05 +01:00
parent bc7438a700
commit d189c5ebe1
3 changed files with 12 additions and 18 deletions

View File

@ -240,9 +240,10 @@ class NeutronApiSDNContext(context.SubordinateConfigContext):
interfaces = 'neutron-plugin-api-subordinate'
def __init__(self):
super(NeutronApiSDNContext, self).__init__(interface='neutron-plugin-api-subordinate',
service='neutron-api',
config_file='/etc/neutron/neutron.conf')
super(NeutronApiSDNContext, self).__init__(
interface='neutron-plugin-api-subordinate',
service='neutron-api',
config_file='/etc/neutron/neutron.conf')
def __call__(self):
ctxt = super(NeutronApiSDNContext, self).__call__()
@ -280,21 +281,15 @@ class NeutronApiSDNContext(context.SubordinateConfigContext):
return ctxt
return ctxt
class NeutronApiSDNConfigFileContext(context.OSContextGenerator):
interfaces = ['neutron-plugin-api-subordinate']
def __call__(self):
ctxt = {}
defaults = {
'neutron-plugin-config': {
'templ_key': 'neutron_plugin_config',
'value': '/etc/neutron/plugins/ml2/ml2_conf.ini',
},
}
for rid in relation_ids('neutron-plugin-api-subordinate'):
for unit in related_units(rid):
rdata = relation_get(rid=rid, unit=unit)
neutron_server_plugin_config = rdata.get('neutron-plugin-config')
if neutron_server_plugin_config:
return { 'config': neutron_server_plugin_config }
return { 'config': '/etc/neutron/plugins/ml2/ml2_conf.ini' }
neutron_server_plugin_conf = rdata.get('neutron-plugin-config')
if neutron_server_plugin_conf:
return {'config': neutron_server_plugin_conf}
return {'config': '/etc/neutron/plugins/ml2/ml2_conf.ini'}

View File

@ -143,8 +143,6 @@ def configure_https():
def install():
execd_preinstall()
configure_installation_source(config('openstack-origin'))
# XXX Remove me when patched nova and neutron are in the main ppa
configure_installation_source('ppa:gnuoy/sdn-test')
apt_update()
apt_install(determine_packages(config('openstack-origin')),

View File

@ -161,6 +161,7 @@ def api_port(service):
def manage_plugin():
return config('manage-neutron-plugin-legacy-mode')
def determine_packages(source=None):
# currently all packages match service names
packages = [] + BASE_PACKAGES
@ -214,8 +215,8 @@ def resource_map():
resource_map.pop(APACHE_24_CONF)
if manage_plugin():
# add neutron plugin requirements. nova-c-c only needs the neutron-server
# associated with configs, not the plugin agent.
# add neutron plugin requirements. nova-c-c only needs the
# neutron-server associated with configs, not the plugin agent.
plugin = config('neutron-plugin')
conf = neutron_plugin_attribute(plugin, 'config', 'neutron')
ctxts = (neutron_plugin_attribute(plugin, 'contexts', 'neutron')