Author: jreidinger Date: Thu Jan 26 16:24:13 2012 New Revision: 67314 URL: http://svn.opensuse.org/viewcvs/yast?rev=67314&view=rev Log: and pass also hardware caching (time to celebrate ruby modules) Modified: branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp Modified: branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp?rev=67314&r1=67313&r2=67314&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp Thu Jan 26 16:24:13 2012 @@ -142,7 +142,7 @@ if (Arch::s390()) { y2milestone ("Interface type: %1", InstallInf["type"]:""); // only some card types need a persistent MAC (bnc#658708) - if (! s390_device_needs_persistent_mac(netdevice)) { + if (! s390_device_needs_persistent_mac(netdevice,hardware)) { InstallInf = remove (InstallInf, "hwaddr"); } // hsi devices do not support setting hwaddr (bnc #479481) Modified: branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp?rev=67314&r1=67313&r2=67314&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp Thu Jan 26 16:24:13 2012 @@ -354,22 +354,22 @@ return need; } -string dev_name_to_sysfs_id(string dev_name) { - // hardware is global, read at client start +string dev_name_to_sysfs_id(string dev_name, list<map> hardware) { + // hardware is cached list of netcards map hw_item = find(map i, hardware, ``( i["dev_name"]:"" == dev_name )); return hw_item["sysfs_id"]:""; } -string sysfs_card_type(string device) { - string sysfs_id = dev_name_to_sysfs_id(device); +string sysfs_card_type(string device,list<map> hardware) { + string sysfs_id = dev_name_to_sysfs_id(device,hardware); if (sysfs_id == "") return "none"; string filename = "/sys" + sysfs_id + "/card_type"; string card_type = (string) SCR::Read(.target.string, filename); return String::FirstChunk(card_type, "\n"); } -boolean s390_device_needs_persistent_mac(string device) { - string card_type = sysfs_card_type(device); +boolean s390_device_needs_persistent_mac(string device,list<map> hardware) { + string card_type = sysfs_card_type(device,hardware); list<string> types_needing_persistent = [ "OSD_100", "OSD_1000", -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org