Actually create /etc/neutron/plugin.ini
Somehow this symlink was lost, so neutron server failed to start without any useful diagnostics (it went to stderr which was redirected to /dev/null). To address the problem we: - cleaned up and fixed code that returns config file name in plugin configurators; - renamed properties that returns the path so that they do not start from 'get_'; - implemented the property in both supported core plugins (linuxbridge and openvswitch) and removed it from non-core plugins; - added code to actually create the symlink at post_install phase. Change-Id: Ia0ce1a3dd156914870a975a893f32e77c9330476
This commit is contained in:
parent
6915184862
commit
1ebb8661e4
@ -114,5 +114,5 @@ class NeutronConfigurator(base.Configurator):
|
||||
}
|
||||
|
||||
@property
|
||||
def get_path_to_core_plugin_config(self):
|
||||
return self.plugin_configurators['core_plugin'].get_plugin_config_file_path
|
||||
def path_to_plugin_config(self):
|
||||
return self.plugin_configurators['core_plugin'].path_to_plugin_config
|
||||
|
@ -15,6 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
from anvil.components.configurators import base
|
||||
from anvil import shell as sh
|
||||
|
||||
|
||||
class Configurator(base.Configurator):
|
||||
@ -23,17 +24,11 @@ class Configurator(base.Configurator):
|
||||
PLUGIN_CLASS = "neutron.plugins.UNKNOWN"
|
||||
|
||||
def __init__(self, installer, configs, adjusters):
|
||||
super(Configurator, self).__init__(
|
||||
installer, configs)
|
||||
super(Configurator, self).__init__(installer, configs)
|
||||
self.config_adjusters = adjusters
|
||||
|
||||
@property
|
||||
def config_files(self):
|
||||
return list(self.configs)
|
||||
|
||||
@property
|
||||
def get_plugin_config_file_path(self):
|
||||
return ""
|
||||
def _config_path(self, name):
|
||||
return sh.joinpths('plugins', self.core_plugin, name)
|
||||
|
||||
|
||||
class CorePluginConfigurator(Configurator):
|
||||
@ -42,7 +37,10 @@ class CorePluginConfigurator(Configurator):
|
||||
self.core_plugin = installer.get_option("core_plugin")
|
||||
super(CorePluginConfigurator, self).__init__(
|
||||
installer,
|
||||
["plugins/%s/%s" % (self.core_plugin, name) for name in configs],
|
||||
dict(
|
||||
("plugins/%s/%s" % (self.core_plugin, key), value)
|
||||
for key, value in adjusters.iteritems()))
|
||||
[self._config_path(name) for name in configs],
|
||||
dict((self._config_path(name), value)
|
||||
for key, value in adjusters.iteritems()))
|
||||
|
||||
@property
|
||||
def path_to_plugin_config(self):
|
||||
raise NotImplementedError()
|
||||
|
@ -45,7 +45,3 @@ class DhcpConfigurator(neutron_plugins.Configurator):
|
||||
|
||||
if self.installer.get_option("core_plugin") == 'openvswitch':
|
||||
plugin_conf.add("interface_driver", "neutron.agent.linux.interface.OVSInterfaceDriver")
|
||||
|
||||
@property
|
||||
def get_plugin_config_file_path(self):
|
||||
return PLUGIN_CONF
|
||||
|
@ -42,7 +42,3 @@ class L3Configurator(neutron_plugins.Configurator):
|
||||
plugin_conf.add("verbose", "True")
|
||||
if self.installer.get_option("core_plugin") == 'openvswitch':
|
||||
plugin_conf.add("interface_driver", "neutron.agent.linux.interface.OVSInterfaceDriver")
|
||||
|
||||
@property
|
||||
def get_plugin_config_file_path(self):
|
||||
return PLUGIN_CONF
|
||||
|
@ -47,3 +47,7 @@ class LinuxbridgeConfigurator(neutron_plugins.CorePluginConfigurator):
|
||||
"LINUX_BRIDGE",
|
||||
"physical_interface_mappings",
|
||||
self.installer.get_option("physical_interface_mappings"))
|
||||
|
||||
@property
|
||||
def path_to_plugin_config(self):
|
||||
return self._config_path(PLUGIN_CONF)
|
||||
|
@ -37,5 +37,5 @@ class OpenvswitchConfigurator(neutron_plugins.CorePluginConfigurator):
|
||||
self.fetch_dbdsn())
|
||||
|
||||
@property
|
||||
def get_plugin_config_file_path(self):
|
||||
return "plugins/%s/%s" % (self.core_plugin, PLUGIN_CONF)
|
||||
def path_to_plugin_config(self):
|
||||
return self._config_path(PLUGIN_CONF)
|
||||
|
@ -50,13 +50,14 @@ class NeutronInstaller(binstall.PythonInstallComponent, NeutronPluginMixin):
|
||||
if self.get_bool_option("db-sync"):
|
||||
self.configurator.setup_db()
|
||||
self._sync_db()
|
||||
self.create_symlink_to_conf_file()
|
||||
|
||||
def _sync_db(self):
|
||||
LOG.info("Syncing neutron to database: %s", colorizer.quote(self.configurator.DB_NAME))
|
||||
# TODO(aababilov): update db if required
|
||||
|
||||
def create_symlink_to_conf_file(self):
|
||||
sh.symlink(self.configurator.get_path_to_plugin_config,
|
||||
sh.symlink(self.configurator.path_to_plugin_config,
|
||||
"/etc/neutron/plugin.ini",
|
||||
force=True)
|
||||
|
||||
|
3
pylintrc
3
pylintrc
@ -49,6 +49,7 @@ load-plugins=
|
||||
# R0801: Similar lines in %s files
|
||||
# R0912: Too many branches (huh)
|
||||
# R0914: Too many local variables is odd.
|
||||
# R0921: Abstract class is not referenced
|
||||
# R0922: Abstract class is only referenced %s times
|
||||
# W0141: Used builtin function %r
|
||||
# W0142: *args and **kwargs are fine.
|
||||
@ -62,7 +63,7 @@ load-plugins=
|
||||
# W0622: Redefining id is fine.
|
||||
# W0702: No exception type(s) specified
|
||||
# W0703: Catching "Exception" is fine if you need it
|
||||
disable=I0011,I0012,I0013,C0111,E0213,E0611,E1002,E1101,E1103,F0401,R0201,R0801,R0912,R0914,R0922,W0141,W0142,W0212,W0223,W0232,W0401,W0511,W0603,W0613,W0622,W0702,W0703
|
||||
disable=I0011,I0012,I0013,C0111,E0213,E0611,E1002,E1101,E1103,F0401,R0201,R0801,R0912,R0914,R0921,R0922,W0141,W0142,W0212,W0223,W0232,W0401,W0511,W0603,W0613,W0622,W0702,W0703
|
||||
|
||||
[REPORTS]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user