[yast-commit] r59595 - /branches/SuSE-Code-11-SP1-Branch/network/src/modules/DNS.ycp
Author: kmachalkova Date: Wed Nov 18 18:24:32 2009 New Revision: 59595 URL: http://svn.opensuse.org/viewcvs/yast?rev=59595&view=rev Log: Improved Import - use user-defined values if present in XML, default or proposed values otherwise Modified: branches/SuSE-Code-11-SP1-Branch/network/src/modules/DNS.ycp Modified: branches/SuSE-Code-11-SP1-Branch/network/src/modules/DNS.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/src/modules/DNS.ycp?rev=59595&r1=59594&r2=59595&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/src/modules/DNS.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/network/src/modules/DNS.ycp Wed Nov 18 18:24:32 2009 @@ -323,13 +323,29 @@ * @return true if success */ global define boolean Import(map settings) { - hostname = settings["hostname"]:""; - domain = settings["domain"]:""; - nameservers = (list<string>) eval(settings["nameservers"]:[]); - searchlist = (list<string>) eval(settings["searchlist"]:[]); dhcp_hostname = settings["dhcp_hostname"]:false; //if not defined, set to 'auto' resolv_conf_policy = settings["resolv_conf_policy"]:"auto"; + // user-defined value has higher priority - FaTE#305281 + if ( haskey(settings, "write_hostname") ) + write_hostname = settings["write_hostname"]:false; + // otherwise, use control.xml default + else + write_hostname = DefaultWriteHostname(); + + // user-defined <hostname> + if ( haskey(settings, "hostname") ) + hostname = settings["hostname"]:""; + else { + // otherwise, check 1) install.inf 2) /etc/HOSTNAME + ReadHostname(); + // if nothing is found, generate a random one + ProposeHostname(); + } + + domain = settings["domain"]:"site"; + nameservers = (list<string>) eval(settings["nameservers"]:[]); + searchlist = (list<string>) eval(settings["searchlist"]:[]); modified = true; initialized = true; return true; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org