From bc4c548f9e30d061b7a3bb472db42ded80b18821 Mon Sep 17 00:00:00 2001 From: Andy Botting Date: Tue, 16 Aug 2016 14:50:36 +1000 Subject: [PATCH] Allow network driver selection override Expose a new [networking]/driver option to allow overriding the network driver. Our use case is that we have multiple external networks and floating IP pools in our cells environment, which Murano does not yet allow you to select. This option allows us to move back to Nova networking where we have code to handle this automatically. Change-Id: Ic4e806dc72283fce6348ab1e2966ba3a618f91dc Closes-Bug: #1617096 --- murano/common/config.py | 6 +++++- murano/db/services/environments.py | 5 +++++ .../notes/config-network-driver-77c82d151dead620.yaml | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/config-network-driver-77c82d151dead620.yaml diff --git a/murano/common/config.py b/murano/common/config.py index ee8ce4b3..72dbdd8d 100644 --- a/murano/common/config.py +++ b/murano/common/config.py @@ -201,7 +201,11 @@ networking_opts = [ cfg.StrOpt('network_config_file', default='netconfig.yaml', help='If provided networking configuration will be taken ' - 'from this file') + 'from this file'), + + cfg.StrOpt('driver', default=None, choices=['neutron', 'nova'], + help='Network driver to use. Options are neutron or nova.' + 'If not provided, the driver will be detected.'), ] stats_opts = [ diff --git a/murano/db/services/environments.py b/murano/db/services/environments.py index 28ec49d1..9ca062e6 100644 --- a/murano/db/services/environments.py +++ b/murano/db/services/environments.py @@ -264,6 +264,11 @@ class EnvironmentServices(object): @staticmethod def get_network_driver(context): + driver = CONF.networking.driver + if driver: + LOG.debug("Will use {} as a network driver".format(driver)) + return driver + session = auth_utils.get_token_client_session( context.auth_token, context.tenant) try: diff --git a/releasenotes/notes/config-network-driver-77c82d151dead620.yaml b/releasenotes/notes/config-network-driver-77c82d151dead620.yaml new file mode 100644 index 00000000..7b4c1e0c --- /dev/null +++ b/releasenotes/notes/config-network-driver-77c82d151dead620.yaml @@ -0,0 +1,4 @@ +--- +features: + - Configuration option added to explicitly select a + networking driver rather than auto-detect.