[PATCH rhel6-branch] Fix --vlanid option in generated kickstart file (#921609)
Radek Vykydal
rvykydal at redhat.com
Fri Jun 21 13:48:16 UTC 2013
Based on patch by Masahiro Matsuya <mmatsuya at redhat.com>.
Resolves: rhbz#921609
---
network.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/network.py b/network.py
index fd9f454..8bc2d21 100644
--- a/network.py
+++ b/network.py
@@ -498,10 +498,16 @@ class Network:
line = "network"
+ # split vlanid from device
+ if dev.get("TYPE") == "Vlan":
+ (device, sep, vlanid) = dev.get("DEVICE").rpartition('.')
+ else:
+ device = dev.get("DEVICE")
+
# ipv4 and ipv6
if dev.get("ONBOOT"):
line += " --onboot %s" % dev.get("ONBOOT")
- line += " --device %s" % dev.get("DEVICE")
+ line += " --device %s" % device
if dev.get('MTU') and dev.get('MTU') != "0":
line += " --mtu=%s" % dev.get('MTU')
@@ -561,6 +567,10 @@ class Network:
self.hostname != "localhost.localdomain"):
line += " --hostname %s" % self.hostname
+ # vlanid
+ if dev.get("TYPE") == "Vlan":
+ line += " --vlanid %s" % vlanid
+
line += "\n"
f.write(line)
--
1.7.11.7
More information about the anaconda-patches
mailing list