Bug 397016

Summary: CLI doesn't work in YaST2 lan
Product: [openSUSE] openSUSE 11.0 Reporter: Michal Zugec <mzugec>
Component: YaST2Assignee: Michal Zugec <mzugec>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Blocker    
Priority: P5 - None CC: cihlarov, locilka
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Michal Zugec 2008-06-04 10:34:08 UTC
Command line interface doesn't work in lan module. Problem is that configuration name is empty (ifcfg-). It should contains device name (ifcfg-eth0)
Comment 1 Michal Zugec 2008-06-04 10:39:38 UTC
Patch to fix that:

Index: src/lan/cmdline.ycp
===================================================================
--- src/lan/cmdline.ycp (revision 48047)
+++ src/lan/cmdline.ycp (working copy)
@@ -181,10 +181,11 @@
    LanItems::current = getItem(options, config);
    LanItems::SetItem();

-  if (!(size(LanItems::getCurrentItem()["ifcfg"]:"")>0)){
+  if (size(LanItems::getCurrentItem()["ifcfg"]:"")==0){
    NetworkInterfaces::Add();
    LanItems::operation = `edit;
    LanItems::interfacename=LanItems::getCurrentItem()["hwinfo", "dev_name"]:"";
+   LanItems::Items[LanItems::current, "ifcfg"] = LanItems::interfacename;
   }

 /*
@@ -216,6 +217,7 @@
                }
              }
 */
+if (contains(Map::Keys(options), "ip")) options["bootproto"] = "static";

     LanItems::bootproto = options["bootproto"]:"none";
     if (!contains(["none", "static", "dhcp"], LanItems::bootproto)){
@@ -224,7 +226,7 @@
         }
     if (LanItems::bootproto=="static"){
            LanItems::ipaddr = options["ip"]:"";
-           LanItems::netmask = options["netmask"]:"";
+           LanItems::netmask = options["netmask"]:"255.255.255.0";
           } else{
                LanItems::ipaddr = "";
                LanItems::netmask = "";
Comment 2 Stephan Kulow 2008-06-04 10:43:21 UTC
not really blocker, but looks safe.
Comment 3 Michal Zugec 2008-06-04 10:51:33 UTC
fixed in yast2-network-2.16.48
Comment 4 Lukas Ocilka 2008-06-04 10:58:59 UTC
Yes, I was also afraid that fixing this bug might break second stage installation (AC/Manual) but it seems it really only changes the behavior of commandline.

Miso, please, next time, add some comments to the source code! :) ;)