aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/objects.py
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2014-08-21 13:25:38 -0400
committerDan Prince <dprince@redhat.com>2014-08-21 13:25:38 -0400
commit3b5e8789871e1722f8a5122236893730cf3d1751 (patch)
tree3a737d9cc6be623264643d39f7540257c8508838 /os_net_config/objects.py
parentdb8deb0a062178ebb99f1a010eb5af79cee2390e (diff)
A vlan on an OVS bridge doesn't require a device
Updates the object model so that a VLAN on top of a bridge (an OVS int port) doesn't require a physical device to be set in the object model.
Diffstat (limited to 'os_net_config/objects.py')
-rw-r--r--os_net_config/objects.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/os_net_config/objects.py b/os_net_config/objects.py
index b73122c..12b1c99 100644
--- a/os_net_config/objects.py
+++ b/os_net_config/objects.py
@@ -205,7 +205,8 @@ class Vlan(_BaseOpts):
@staticmethod
def from_json(json):
- device = _get_required_field(json, 'device', 'Vlan')
+ # A vlan on an OVS bridge won't require a device (OVS Int Port)
+ device = json.get('device')
vlan_id = _get_required_field(json, 'vlan_id', 'Vlan')
opts = _BaseOpts.base_opts_from_json(json)
return Vlan(device, vlan_id, *opts)