diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2013-01-04 12:20:31 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2013-01-10 10:25:30 +0000 |
commit | 67cd497f6a140b1295cd34f138a3d797680a9ef1 (patch) | |
tree | 772515810d015ee5decbcea1540e476b011ec03f | |
parent | bcb99833e7f0c628df4e0778aee4a3bcd92588b4 (diff) | |
download | nova-67cd497f6a140b1295cd34f138a3d797680a9ef1.tar.gz nova-67cd497f6a140b1295cd34f138a3d797680a9ef1.tar.xz nova-67cd497f6a140b1295cd34f138a3d797680a9ef1.zip |
Add some constants to the network model for drivers to use
Following on from
commit 85f857e62a5edacbf467c19add6e51565ae3669f
Author: Gary Kotton <gkotton@redhat.com>
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 <berrange@redhat.com>
-rw-r--r-- | nova/network/model.py | 11 |
1 files changed, 11 insertions, 0 deletions
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.""" |