[yast-commit] r67192 - in /branches/SuSE-Code-11-SP2-Branch/network: package/yast2-network.changes src/clients/lan_auto.ycp
Author: mvidner Date: Fri Jan 13 15:39:21 2012 New Revision: 67192 URL: http://svn.opensuse.org/viewcvs/yast?rev=67192&view=rev Log: AY keep_install_network: merge dns and routing from linuxrc item by item, not just in bulk (bnc#712864). Modified: branches/SuSE-Code-11-SP2-Branch/network/package/yast2-network.changes branches/SuSE-Code-11-SP2-Branch/network/src/clients/lan_auto.ycp Modified: branches/SuSE-Code-11-SP2-Branch/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/network/package/yast2-network.changes?rev=67192&r1=67191&r2=67192&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/network/package/yast2-network.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/network/package/yast2-network.changes Fri Jan 13 15:39:21 2012 @@ -1,6 +1,8 @@ ------------------------------------------------------------------- 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.17.166 Modified: branches/SuSE-Code-11-SP2-Branch/network/src/clients/lan_auto.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/network/src/clients/lan_auto.ycp?rev=67192&r1=67191&r2=67192&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/network/src/clients/lan_auto.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/network/src/clients/lan_auto.ycp Fri Jan 13 15:39:21 2012 @@ -288,26 +288,31 @@ 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 + // and merge with XML data (bnc#712864) 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"); - } + // 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); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mvidner@svn2.opensuse.org