[PATCH 3/5] Adapt ifcfg -> ksdata mapping to NM change from IPADDR to IPADDR0.

Radek Vykydal rvykydal at redhat.com
Wed Jan 30 15:11:41 UTC 2013


We might read the configuration from NM instead of ifcfg in future
but some pieces are still missing.
---
 pyanaconda/network.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 8edeab0..c1e7626 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -652,6 +652,17 @@ def kickstartNetworkData(ifcfg=None, hostname=None):
             # note that --gateway is common for ipv4 and ipv6
             if ifcfg.get('GATEWAY'):
                 kwargs["gateway"] = ifcfg.get('GATEWAY')
+        elif ifcfg.get('IPADDR0'):
+            kwargs["bootProto"] = "static"
+            kwargs["ip"] = ifcfg.get('IPADDR0')
+            prefix  = ifcfg.get('PREFIX0')
+            if prefix:
+                netmask = isys.prefix2netmask(int(prefix))
+                kwargs["netmask"] = netmask
+            # note that --gateway is common for ipv4 and ipv6
+            if ifcfg.get('GATEWAY0'):
+                kwargs["gateway"] = ifcfg.get('GATEWAY0')
+
 
     # ipv6
     if (not ifcfg.get('IPV6INIT') or
-- 
1.7.11.7



More information about the anaconda-patches mailing list