Author: mvidner Date: Fri Jan 13 15:54:33 2012 New Revision: 67193 URL: http://svn.opensuse.org/viewcvs/yast?rev=67193&view=rev Log: - AY keep_install_network: merge dns and routing from linuxrc item by item, not just in bulk (bnc#712864). - Clarified the label for BOOTPROTO=none: "No Setup (Bridge or Bonding Slaves)" (bnc#737333). svn merge -r67186:67192 http://svn.opensuse.org/svn/yast/branches/SuSE-Code-11-SP2-Branch/network Modified: trunk/network/ (props changed) trunk/network/VERSION trunk/network/package/yast2-network.changes trunk/network/src/clients/lan_auto.ycp trunk/network/src/lan/address.ycp trunk/network/src/lan/hardware.ycp trunk/network/src/modules/LanItems.ycp Modified: trunk/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=67193&r1=... ============================================================================== --- trunk/network/VERSION (original) +++ trunk/network/VERSION Fri Jan 13 15:54:33 2012 @@ -1 +1 @@ -2.22.0 +2.22.1 Modified: trunk/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.cha... ============================================================================== --- trunk/network/package/yast2-network.changes (original) +++ trunk/network/package/yast2-network.changes Fri Jan 13 15:54:33 2012 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Thu Jan 12 15:52:47 CET 2012 - mvidner@suse.cz + +- AY keep_install_network: merge dns and routing from linuxrc + item by item, not just in bulk (bnc#712864). +- Clarified the label for BOOTPROTO=none: "No Setup (Bridge or + Bonding Slaves)" (bnc#737333). +- 2.22.1 + +------------------------------------------------------------------- Fri Jan 6 16:17:00 CET 2012 - mvidner@suse.cz - skip USB NICs during bridge proposal (bnc#710098) Modified: trunk/network/src/clients/lan_auto.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/clients/lan_auto.ycp?... ============================================================================== --- trunk/network/src/clients/lan_auto.ycp (original) +++ trunk/network/src/clients/lan_auto.ycp Fri Jan 13 15:54:33 2012 @@ -70,27 +70,29 @@ */ define map FromAY(map input) { - y2debug("input %1", input); + y2debug("input %1", input); - list<map<string,any> > ifaces=[]; - foreach(map<string,any> interface, input["interfaces"]:[], { - map<string,any> iface=$[]; - foreach(string key, any value, interface, { - if (key == "aliases"){ - foreach(string k, map<string,any > v, (map<string, map<string,any> >)value, { - // replace "alias0" to "0" (bnc#372687) - map<string,any> t = (map<string,any>)value; - t[v["LABEL"]:""]=t[k]:$[]; - t=remove(t,k); - value=t; - }); - } else - if (key=="device") value = LanUdevAuto::getDeviceName(tostring(value)); - iface[key]=value; - }); - ifaces = add(ifaces, iface); - }); - input["interfaces"] = ifaces; + list<map<string,any> > ifaces=[]; + foreach(map<string,any> interface, input["interfaces"]:[], { + map<string,any> iface=$[]; + foreach(string key, any value, interface, { + if (key == "aliases"){ + foreach(string k, map<string,any > v, (map<string, map<string,any> >)value, { + // replace "alias0" to "0" (bnc#372687) + map<string,any> t = (map<string,any>)value; + t[v["LABEL"]:""]=t[k]:$[]; + t=remove(t,k); + value=t; + }); + } + else if (key=="device") { + value = LanUdevAuto::getDeviceName(tostring(value)); + } + iface[key]=value; + }); + ifaces = add(ifaces, iface); + }); + input["interfaces"] = ifaces; map<string,map> interfaces = listmap(map<string, any> interface, (list<map<string, any> >)input["interfaces"]:[], @@ -286,29 +288,34 @@ ret = LanAutoSequence(""); } else if(func == "Import") { - // see bnc#498993 - // in case keep_install_network is set to true (in AY) - // and there is no dns and routing definition, - // we'll keep values from installation - if(param["keep_install_network"]:false==true) { - y2milestone("keep_install_network is enabled"); - if(param["dns"]:$[]==$[] && param["routing"]:$[]==$[]){ - y2milestone("DNS and routing are not defined in AY, will keep settings from installation"); - // read settings from installation - Lan::Read(`cache); - // export settings into AY map - map from_system=Lan::Export(); - map dns=from_system["dns"]:$[]; - map routing=from_system["routing"]:$[]; - // merge with param - param["dns"]=dns; - param["routing"]=routing; - y2milestone("dns %1", dns); - y2milestone("routing %1", routing); - } else{ - y2milestone("DNS and routing defined in AY profile, will use it"); - } - } + // see bnc#498993 + // in case keep_install_network is set to true (in AY) + // we'll keep values from installation + // and merge with XML data (bnc#712864) + if(param["keep_install_network"]:false==true) { + // read settings from installation + Lan::Read(`cache); + // export settings into AY map + map from_system=Lan::Export(); + map dns = from_system["dns"]:$[]; + map routing = from_system["routing"]:$[]; + + // copy the keys/values that are not existing in the XML + // so we merge the inst-sys settings with the XML while XML + // has higher priority + foreach( string key, any value, dns, { + if( ! haskey( param["dns"]:$[], key ) ) { + y2milestone("(dns) taking %1 from inst-sys. Value = %2", key, value); + param["dns",key] = value; + } + }); + foreach( string key, any value, routing, { + if( ! haskey( param["routing"]:$[], key ) ) { + param["routing",key] = value; + y2milestone("(routing) taking %1 from inst-sys. Value = %2", key, value); + } + }); + } map new = FromAY(param); Lan::Import(new); ret = true; Modified: trunk/network/src/lan/address.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=6... ============================================================================== --- trunk/network/src/lan/address.ycp (original) +++ trunk/network/src/lan/address.ycp Fri Jan 13 15:54:33 2012 @@ -323,7 +323,7 @@ else */ if (LanItems::type!="eth") UI::ReplaceWidget(`rp, `Left( - `RadioButton(`id(`none),`opt(`notify), _("No IP Address (for Bonding Devices)")))); + `RadioButton(`id(`none),`opt(`notify), _("No Setup (Bridge or Bonding Slaves)")))); switch(settings["BOOTPROTO"]:""){ case "static": UI::ChangeWidget(`id(`bootproto), `CurrentButton, `static); UI::ChangeWidget(`id(`ipaddr), `Value, settings["IPADDR"]:""); @@ -781,7 +781,7 @@ `ReplacePoint(`id(`rp), `Left( `HBox( - `RadioButton(`id(`none),`opt(`notify), _("No IP Address (for Bonding Devices)")), + `RadioButton(`id(`none),`opt(`notify), _("No Setup (Bridge or Bonding Slaves)")), `HSpacing(1), `CheckBox(`id(`ibft), `opt(`notify), _("Use iBFT values")) ) Modified: trunk/network/src/lan/hardware.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/hardware.ycp?rev=... ============================================================================== --- trunk/network/src/lan/hardware.ycp (original) +++ trunk/network/src/lan/hardware.ycp Fri Jan 13 15:54:33 2012 @@ -594,7 +594,6 @@ /* TextEntry label */ `InputField(`id(`qeth_macaddress), `opt(`hstretch), _("Layer2 &MAC Address"), LanItems::qeth_macaddress), `VSpacing(1), -// `InputField(`id(`qeth_chanids), `opt(`hstretch), _("CHAN IDS"), LanItems::qeth_chanids) `HBox( `InputField(`id(`qeth_chan_read), `opt(`hstretch), _("Read Channel"), chanids_map["read"]:""), `InputField(`id(`qeth_chan_write), `opt(`hstretch), _("Write Channel"), chanids_map["write"]:""), @@ -612,29 +611,6 @@ _("<p>Enter the <b>Layer 2 MAC Address</b> if this card has been configured with layer 2 support.</p>"); } -/* - if(LanItems::type == "hsi") { - contents = `HBox( - `HSpacing(6), - `Frame(_("S/390 Device Settings"), `HBox(`HSpacing(2), `VBox( - `VSpacing(1), - `InputField(`id(`qeth_options), `opt(`hstretch), Label::Options (), LanItems::qeth_options), - `VSpacing(1), - `Left(`CheckBox(`id(`ipa_takeover), _("&Enable IPA Takeover"))), - `VSpacing(1), - `Left(`CheckBox(`id(`qeth_layer2), `opt(`notify), _("Enable &Layer 2 Support"))), - `InputField(`id(`qeth_macaddress), `opt(`hstretch), _("Layer2 &MAC Address"), LanItems::qeth_macaddress), - `VSpacing(1) - ), `HSpacing(2))), - `HSpacing(6) - ); - helptext = _("<p>Enter any additional <b>Options</b> for this interface (separated by spaces).</p>") + - _("<p>Select <b>Enable IPA Takeover</b> if IP address takeover should be enabled for this interface.</p>") + - _("<p>Select <b>Enable Layer 2 Support</b> if this card has been configured with layer 2 support.</p>") + - _("<p>Enter the <b>Layer 2 MAC Address</b> if this card has been configured with layer 2 support.</p>"); - } -*/ - if(drvtype == "lcs") { list<string> tmp_list=splitstring(LanItems::qeth_chanids, " "); map<string, any> chanids_map = $[ @@ -767,8 +743,7 @@ LanItems::nm_name = "static-iucv-id-" + (string) UI::QueryWidget(`id(`chan_mode), `Value); LanItems::device = "id-" + (string) UI::QueryWidget(`id(`chan_mode), `Value); } -// if (LanItems::type != "hsi") - LanItems::chan_mode = (string) UI::QueryWidget(`id(`chan_mode), `Value); + LanItems::chan_mode = (string) UI::QueryWidget(`id(`chan_mode), `Value); if(LanItems::type == "lcs") LanItems::lcs_timeout = (string) UI::QueryWidget(`id(`lcs_timeout), `Value); Modified: trunk/network/src/modules/LanItems.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanItems.ycp?... ============================================================================== --- trunk/network/src/modules/LanItems.ycp (original) +++ trunk/network/src/modules/LanItems.ycp Fri Jan 13 15:54:33 2012 @@ -975,8 +975,6 @@ global define boolean Select(string dev) { y2debug("dev=%1", dev); map devmap = $[]; - /* dev=="" -> Add */ -// if(dev == "") { // defaults for a new device devmap = $[ // for hotplug devices set STARTMODE=hotplug (#132583) @@ -1009,27 +1007,24 @@ type = Items[current, "hwinfo", "type"]:"eth"; device = NetworkInterfaces::GetFreeDevice(type); - // TODO: instead of udev use hwinfo dev_name NetworkInterfaces::Name = GetItemUdev("NAME"); if (size(Items)<current) Items[current] = $["ifcfg":NetworkInterfaces::Name]; else Items[current, "ifcfg"] = NetworkInterfaces::Name; - /* FIXME: alias: how to prefill new alias? */ alias = ""; + /* general stuff */ description = BuildDescription (type, device, devmap, Hardware); SetDeviceVars(devmap, SysconfigDefaults); hotplug = ""; - y2debug("type=%1", type); if(issubstring(type, "-")) type = regexpsub(type, "([^-]+)-.*$", "\1"); y2debug("type=%1", type); - /* We always have to set the MAC Address for qeth Layer2 support */ if (qeth_layer2 ) { qeth_macaddress = devmap["LLADDR"]:"00:00:00:00:00:00"; @@ -1408,9 +1403,7 @@ SetDeviceVars(devmap, SysconfigDefaults); - hotplug = ""; - y2debug("type=%1", type); if(issubstring(type, "-")) type = regexpsub(type, "([^-]+)-.*$", "\1"); y2debug("type=%1", type); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org