From 67cd497f6a140b1295cd34f138a3d797680a9ef1 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 4 Jan 2013 12:20:31 +0000 Subject: Add some constants to the network model for drivers to use Following on from commit 85f857e62a5edacbf467c19add6e51565ae3669f Author: Gary Kotton Date: Sat Dec 8 08:54:16 2012 +0000 Add vif_type to the VIF model add some constants to nova.network.model to enumerate the valid values for 'vif_type'. Also add a constant for max bridge name length Blueprint: libvirt-vif-driver Change-Id: I47949c06fee732681bf0b547577f22a319d4e408 Signed-off-by: Daniel P. Berrange --- nova/network/model.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nova/network/model.py b/nova/network/model.py index dcee68f8c..f0a5d9d89 100644 --- a/nova/network/model.py +++ b/nova/network/model.py @@ -25,6 +25,17 @@ def ensure_string_keys(d): # http://bugs.python.org/issue4978 return dict([(str(k), v) for k, v in d.iteritems()]) +# Constants for the 'vif_type' field in VIF class +VIF_TYPE_OVS = 'ovs' +VIF_TYPE_BRIDGE = 'bridge' +VIF_TYPE_802_QBG = '802.1qbg' +VIF_TYPE_802_QBH = '802.1qbh' +VIF_TYPE_OTHER = 'other' + +# Constant for max length of 'bridge' in Network class +# Chosen to match max Linux NIC name length +BRIDGE_NAME_LEN = 14 + class Model(dict): """Defines some necessary structures for most of the network models.""" -- cgit