[yast-commit] r51775 - /trunk/yast2/library/types/src/Hostname.ycp
Author: kmachalkova Date: Thu Oct 2 11:31:01 2008 New Revision: 51775 URL: http://svn.opensuse.org/viewcvs/yast?rev=51775&view=rev Log: Improved FQDN lookup - read /etc/HOSTNAME and use 'linux.site' if all else fails (#429792) Modified: trunk/yast2/library/types/src/Hostname.ycp Modified: trunk/yast2/library/types/src/Hostname.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/types/src/Hostname.ycp?rev=51775&r1=51774&r2=51775&view=diff ============================================================================== --- trunk/yast2/library/types/src/Hostname.ycp (original) +++ trunk/yast2/library/types/src/Hostname.ycp Thu Oct 2 11:31:01 2008 @@ -143,7 +143,16 @@ map hostname_data = (map) SCR::Execute(.target.bash_output, "hostname --fqdn"); if (hostname_data == nil || hostname_data["exit"]:-1 != 0 ) - y2error("Failed to retrieve current FQ hostname"); + { + fqhostname = (string) SCR::Read(.target.string, "/etc/HOSTNAME"); + + if ( fqhostname == "" || fqhostname == nil ) + { + //last resort (#429792) + fqhostname = "linux.site"; + } + y2warning("Using fallback hostname %1", fqhostname); + } else { fqhostname = String::FirstChunk( hostname_data["stdout"]:"", "\n"); -- 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