aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_ifcfg.py
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri@redhat.com>2015-11-20 15:56:37 -0500
committerGonéri Le Bouder <goneri@redhat.com>2015-11-20 16:00:57 -0500
commitf00d545041b75b5d3e215bf435689e933dbb4f62 (patch)
tree6142e55ed25e50da4c597684d197f1ee34d6700f /os_net_config/impl_ifcfg.py
parentf0c42a7cda2997c4ce81096ffc778f565e1c9d1d (diff)
ifcfg: add VLAN=yes when needed
Add the VLAN=yes parameter if the interface name is in the foo.123 format. This is the behavior and Debian allow the same os-net-config configuration file to be consistent with Red Hat systems. See also: https://bugzilla.redhat.com/show_bug.cgi?id=1283812 Change-Id: Iab2a4861e2231b34899c379963abbef59cf73328 Closes-Bug: #1518449
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r--os_net_config/impl_ifcfg.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index 0deb61e..70f5065 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -16,6 +16,7 @@
import glob
import logging
+import re
import os_net_config
from os_net_config import objects
@@ -83,6 +84,8 @@ class IfcfgNetConfig(os_net_config.NetConfig):
data += "VLAN=yes\n"
if base_opt.device:
data += "PHYSDEV=%s\n" % base_opt.device
+ elif re.match('\w+\.\d+$', base_opt.name):
+ data += "VLAN=yes\n"
if base_opt.ovs_port:
data += "DEVICETYPE=ovs\n"
if base_opt.bridge_name: