summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Authors1
-rw-r--r--nova/network/quantum/manager.py46
2 files changed, 47 insertions, 0 deletions
diff --git a/Authors b/Authors
index 159296731..43360384a 100644
--- a/Authors
+++ b/Authors
@@ -35,6 +35,7 @@ Cory Wright <corywright@gmail.com>
Dan Prince <dan.prince@rackspace.com>
Dan Wendlandt <dan@nicira.com>
Daniel P. Berrange <berrange@redhat.com>
+Dave Lapsley <dlapsley@nicira.com>
Dave Walker <DaveWalker@ubuntu.com>
David Pravec <David.Pravec@danix.org>
David Subiros <david.perez5@hp.com>
diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py
index 4e3459011..8a1dfa488 100644
--- a/nova/network/quantum/manager.py
+++ b/nova/network/quantum/manager.py
@@ -132,9 +132,55 @@ class QuantumManager(manager.FlatManager):
In both cases, we initialize a subnet using the IPAM lib.
"""
+ # Enforce Configuration sanity.
+ #
+ # These flags are passed in from bin/nova-manage. The script
+ # collects the arguments and then passes them in through this
+ # function call. Note that in some cases, the script pre-processes
+ # the arguments, and sets them to a default value if a parameter's
+ # value was not specified on the command line. For pre-processed
+ # parameters, the most effective check to see if the user passed it
+ # in is to see if is different from the default value. (This
+ # does miss the use case where the user passes in the default value
+ # on the command line -- but it is unavoidable.)
+ if multi_host != FLAGS.multi_host:
+ # User specified it on the command line.
+ raise Exception(_("QuantumManager does not use 'multi_host'"
+ " parameter."))
+
if num_networks != 1:
raise Exception(_("QuantumManager requires that only one"
" network is created per call"))
+
+ if network_size != int(FLAGS.network_size):
+ # User specified it on the command line.
+ LOG.warning("Ignoring unnecessary parameter 'network_size'")
+
+ if kwargs.get('vlan_start', None):
+ if kwargs['vlan_start'] != int(FLAGS.vlan_start):
+ # User specified it on the command line.
+ LOG.warning(_("QuantumManager does not use 'vlan_start'"
+ " parameter."))
+
+ if kwargs.get('vpn_start', None):
+ if kwargs['vpn_start'] != int(FLAGS.vpn_start):
+ # User specified it on the command line.
+ LOG.warning(_("QuantumManager does not use 'vpn_start'"
+ " parameter."))
+
+ if bridge is not None and len(bridge) > 0:
+ LOG.warning(_("QuantumManager does not use 'bridge'"
+ " parameter."))
+
+ if bridge_interface is not None and len(bridge_interface) > 0:
+ LOG.warning(_("QuantumManager does not use 'bridge_interface'"
+ " parameter."))
+
+ if gateway is not None and len(gateway) > 0:
+ if gateway.split('.')[3] != '1':
+ raise Exception(_("QuantumManager requires a valid (.1)"
+ " gateway address."))
+
q_tenant_id = kwargs["project_id"] or FLAGS.quantum_default_tenant_id
quantum_net_id = uuid
# If a uuid was specified with the network it should have already been