Author: jdsn Date: Wed Oct 14 15:12:09 2009 New Revision: 59016 URL: http://svn.opensuse.org/viewcvs/yast?rev=59016&view=rev Log: read also guid in registration configuration Modified: trunk/registration/src/modules/YSR.pm_web Modified: trunk/registration/src/modules/YSR.pm_web URL: http://svn.opensuse.org/viewcvs/yast/trunk/registration/src/modules/YSR.pm_web?rev=59016&r1=59015&r2=59016&view=diff ============================================================================== --- trunk/registration/src/modules/YSR.pm_web (original) +++ trunk/registration/src/modules/YSR.pm_web Wed Oct 14 15:12:09 2009 @@ -235,10 +235,13 @@ my $self = shift; my $SRconf = '/etc/suseRegister.conf'; my $SRcert = '/etc/ssl/certs/registration-server.pem'; + my $SRcredentials = '/etc/zypp/credentials.d/NCCcredentials'; my $url = undef; my $cert = undef; + my $guid = undef; + # read the registration server url if ( -e $SRconf ) { if (open(CNF, "< $SRconf") ) @@ -254,6 +257,7 @@ } } + #read the registration server ca certificate file if ( -e $SRcert ) { my $separator = $/; @@ -266,8 +270,30 @@ $/ = $separator; } - return { "url" => $url, - "certificate" => $cert }; + # read the guid + if (-e $SRcredentials) + { + if (open(CRED, "< $SRcredentials") ) + { + while(<CRED>) + { + next if($_ =~ /^\s*#/); + + if($_ =~ /^\s*username\s*=\s*(\S*)\s*/ && defined $1 && $1 ne '') + { $guid = $1; } + } + close CRED; + } + } + + + $url = '' unless defined $url; + $cert = '' unless defined $cert; + $guid = '' unless defined $guid; + + return { "regserverurl" => $url, + "regserverca" => $cert, + "guid" => $guid }; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org