From 7f5c71117c854d0ea2100cc9ac423bb71fef0ea6 Mon Sep 17 00:00:00 2001 From: ativelkov Date: Tue, 26 Nov 2013 20:54:26 +0400 Subject: [PATCH] NovaNetwork support Conductor can now properly run on nova-network deployments Fixes bug #1255057 Change-Id: I7c5e829c58f9dcb242ae580bea0408329a82aa3f --- doc/source/index.rst | 7 ++++--- etc/conductor.conf | 8 +++++--- muranoconductor/commands/dispatcher.py | 6 ++++-- muranoconductor/config.py | 5 ++++- muranoconductor/network.py | 5 +---- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 002e142..337bd53 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -73,9 +73,10 @@ Configure # Template IP address for generating environment subnet cidrs env_ip_template = 10.0.0.0 - # Enforces flat network topology by default. - # If set to "False", routed topology will be used - flat_by_default = False + # Enforces default network topology. + # Allowed values: nova, flat, routed + # default is routed + network_topology = routed [keystone] # URL of OpenStack KeyStone service REST API. diff --git a/etc/conductor.conf b/etc/conductor.conf index 30c615b..1d04721 100644 --- a/etc/conductor.conf +++ b/etc/conductor.conf @@ -29,9 +29,11 @@ max_hosts = 250 # Template IP address for generating environment subnet cidrs env_ip_template = 10.0.0.0 -# Enforces flat network topology by default. -# If set to "False", routed topology will be used -flat_by_default = False +# Enforces default network topology. +# Allowed values: nova, flat, routed +# default is routed +# network_topology = routed +network_topology = nova [keystone] # URL of OpenStack KeyStone service REST API. diff --git a/muranoconductor/commands/dispatcher.py b/muranoconductor/commands/dispatcher.py index 5f612fb..de5ea18 100644 --- a/muranoconductor/commands/dispatcher.py +++ b/muranoconductor/commands/dispatcher.py @@ -17,6 +17,7 @@ import command import cloud_formation import network import vm_agent +from muranoconductor import config as cfg class CommandDispatcher(command.CommandBase): @@ -26,9 +27,10 @@ class CommandDispatcher(command.CommandBase): reporter), 'agent': vm_agent.VmAgentExecutor( environment, rmqclient, reporter), - - 'net': network.NeutronExecutor(tenant_id, token) } + if cfg.CONF.network_topology != "nova": + self._command_map['net'] = \ + network.NeutronExecutor(tenant_id, token) def execute(self, name, **kwargs): self._command_map[name].execute(**kwargs) diff --git a/muranoconductor/config.py b/muranoconductor/config.py index 6b2e86c..cfbfbf4 100644 --- a/muranoconductor/config.py +++ b/muranoconductor/config.py @@ -27,6 +27,7 @@ from oslo.config import cfg from paste import deploy from muranoconductor import __version__ as version +from muranoconductor.openstack.common import log from ConfigParser import SafeConfigParser paste_deploy_opts = [ @@ -86,7 +87,9 @@ CONF.register_cli_opt(cfg.StrOpt('murano_metadata_url')) CONF.register_opt(cfg.IntOpt('max_environments', default=20)) CONF.register_opt(cfg.IntOpt('max_hosts', default=250)) CONF.register_opt(cfg.StrOpt('env_ip_template', default='10.0.0.0')) -CONF.register_opt(cfg.BoolOpt('flat_by_default', default=False)) +CONF.register_opt(cfg.StrOpt('network_topology', + choices=['nova', 'flat', 'routed'], + default='routed')) CONF.import_opt('verbose', 'muranoconductor.openstack.common.log') diff --git a/muranoconductor/network.py b/muranoconductor/network.py index af3a10c..e61f06e 100644 --- a/muranoconductor/network.py +++ b/muranoconductor/network.py @@ -73,10 +73,7 @@ def get_default_network(engine, context, body, result=None): def get_network_topology(engine, context, body, result=None): - if muranoconductor.config.CONF.flat_by_default: - return "flat" - else: - return "routed" + return muranoconductor.config.CONF.network_topology xml_code_engine.XmlCodeEngine.register_function(