Author: kmachalkova Date: Mon Aug 11 13:05:00 2008 New Revision: 49926 URL: http://svn.opensuse.org/viewcvs/yast?rev=49926&view=rev Log: Do not split FQDN into pieces if it is of the form of IP address (#415108) 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=49926&r1=49925&r2=49926&view=diff ============================================================================== --- trunk/yast2/library/types/src/Hostname.ycp (original) +++ trunk/yast2/library/types/src/Hostname.ycp Mon Aug 11 13:05:00 2008 @@ -161,12 +161,21 @@ string hostname = ""; string fqhostname = CurrentFQ(); - list <string> data = SplitFQ( fqhostname); + //current FQDN is IP address - it happens, esp. in inst-sys :) + //so let's not cut it into pieces (#415109) + if ( IP::Check( fqhostname ) ) + { + hostname = fqhostname; + } + else + { + list <string> data = SplitFQ( fqhostname); - if ( data != [] ) - hostname = data[0]:""; + if ( data != [] ) + hostname = data[0]:""; - y2debug("Current hostname: %1", hostname); + y2debug("Current hostname: %1", hostname); + } return hostname; } @@ -178,10 +187,15 @@ string domain = ""; string fqhostname = CurrentFQ(); - list <string> data = SplitFQ( fqhostname); - - if ( data != [] && ( size( data ) > 1 ) ) - domain = data[1]:""; + //the same as above, if FQDN is IP address + //let's claim domainname as empty (#415109) + if ( !IP::Check ( fqhostname ) ) + { + list <string> data = SplitFQ( fqhostname); + + if ( data != [] && ( size( data ) > 1 ) ) + domain = data[1]:""; + } y2debug("Current domainname: %1", domain); return domain; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org