Author: jdsn
Date: Sat Aug 28 01:24:30 2010
New Revision: 62441
URL: http://svn.opensuse.org/viewcvs/yast?rev=62441&view=rev
Log:
Created tag stable-2_19_7 for registration
Added:
tags/stable-2_19_7/registration/
- copied from r62440, trunk/registration/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
Author: jdsn
Date: Sat Aug 28 01:24:24 2010
New Revision: 62440
URL: http://svn.opensuse.org/viewcvs/yast?rev=62440&view=rev
Log:
Created tag branch-Code-11-SP1-2_17_35 for registration
Added:
tags/branch-Code-11-SP1-2_17_35/registration/ (props changed)
- copied from r62439, branches/SuSE-Code-11-SP1-Branch/registration/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
Author: jdsn
Date: Sat Aug 28 01:07:23 2010
New Revision: 62439
URL: http://svn.opensuse.org/viewcvs/yast?rev=62439&view=rev
Log:
fix changes file, mention relevant bug number
Modified:
branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes
Modified: branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/regis…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes Sat Aug 28 01:07:23 2010
@@ -1,7 +1,8 @@
-------------------------------------------------------------------
Fri Aug 27 20:33:46 CEST 2010 - jdsn(a)suse.de
-- fix registration status detection, common flag file (bnc#634026)
+- fix registration status detection (bnc#634026)
+ use a common flag file (bnc#633183)
- fix proxy settings for WebYaST registrations (bnc#626965)
- 2.17.35
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
Author: jdsn
Date: Sat Aug 28 01:04:43 2010
New Revision: 62438
URL: http://svn.opensuse.org/viewcvs/yast?rev=62438&view=rev
Log:
fix changes file, mention relevant bug number
Modified:
trunk/registration/package/yast2-registration.changes
Modified: trunk/registration/package/yast2-registration.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/registration/package/yast2-regis…
==============================================================================
--- trunk/registration/package/yast2-registration.changes (original)
+++ trunk/registration/package/yast2-registration.changes Sat Aug 28 01:04:43 2010
@@ -1,7 +1,8 @@
-------------------------------------------------------------------
Sat Aug 28 00:43:11 CEST 2010 - jdsn(a)suse.de
-- fix registration status detection, common flag file (bnc#634026)
+- fix registration status detection (bnc#634026)
+ use a common flag file (bnc#633183)
- fix proxy settings for WebYaST registrations (bnc#626965)
- 2.19.7
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
Author: jdsn
Date: Sat Aug 28 00:50:50 2010
New Revision: 62437
URL: http://svn.opensuse.org/viewcvs/yast?rev=62437&view=rev
Log:
fix registration status detection, common flag file (bnc#634026)
fix proxy settings for WebYaST registrations (bnc#626965)
2.19.7
Modified:
trunk/registration/VERSION
trunk/registration/package/yast2-registration.changes
trunk/registration/src/modules/Register.ycp
trunk/registration/src/modules/YSR.pm
Modified: trunk/registration/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/registration/VERSION?rev=62437&r…
==============================================================================
--- trunk/registration/VERSION (original)
+++ trunk/registration/VERSION Sat Aug 28 00:50:50 2010
@@ -1 +1 @@
-2.19.6
+2.19.7
Modified: trunk/registration/package/yast2-registration.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/registration/package/yast2-regis…
==============================================================================
--- trunk/registration/package/yast2-registration.changes (original)
+++ trunk/registration/package/yast2-registration.changes Sat Aug 28 00:50:50 2010
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Sat Aug 28 00:43:11 CEST 2010 - jdsn(a)suse.de
+
+- fix registration status detection, common flag file (bnc#634026)
+- fix proxy settings for WebYaST registrations (bnc#626965)
+- 2.19.7
+
+-------------------------------------------------------------------
Fri Aug 20 15:45:49 CEST 2010 - jdsn(a)suse.de
- use correct error code for backend init errors (bnc#633183)
Modified: trunk/registration/src/modules/Register.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/registration/src/modules/Registe…
==============================================================================
--- trunk/registration/src/modules/Register.ycp (original)
+++ trunk/registration/src/modules/Register.ycp Sat Aug 28 00:50:50 2010
@@ -1521,8 +1521,9 @@
if ( initialSRstatus == 0 )
{
y2milestone("SuseRegister returned with status: %1", initialSRstatus);
- // touch webyast flag file to show in webyast that this machine is already registered
- SCR::Execute(.target.bash, sformat(" [ -d /var/lib/yastws ] && touch /var/lib/yastws/enable_SLM_webyast_registration_workaround "));
+ // touch webyast flag file to show in webyast that this machine is already registered (bnc#634026)
+ SCR::Execute(.target.bash, " [ -d /var/lib/yastws ] && date +%s > /var/lib/yastws/registration_successful " );
+ SCR::Execute(.target.bash, " [ -d /var/lib/suseRegister ] && date +%s > /var/lib/suseRegister/y2_registration_successful " );
}
Modified: trunk/registration/src/modules/YSR.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/registration/src/modules/YSR.pm?…
==============================================================================
--- trunk/registration/src/modules/YSR.pm (original)
+++ trunk/registration/src/modules/YSR.pm Sat Aug 28 00:50:50 2010
@@ -20,6 +20,12 @@
my $global_ctx = {};
+# flag files for registration status
+my $FFwebyast_dir = '/var/lib/yastws';
+my $FFwebyast = $FFwebyast_dir.'/registration_successful';
+my $FFgeneric_dir = '/var/lib/suseRegister';
+my $FFgeneric = $FFgeneric_dir.'/y2_registration_successful';
+
# set the PATH in the perl environment (bnc#621914)
# otherwise it is empty in system calls
$ENV{PATH}="/usr/bin:/sbin:/usr/sbin:/bin";
@@ -185,6 +191,13 @@
}
}
+BEGIN { $TYPEINFO{unset_proxy} = ["function", "void"]; }
+sub unset_proxy
+{
+ my $self = shift;
+ delete $ENV{http_proxy};
+ delete $ENV{https_proxy};
+}
BEGIN { $TYPEINFO{statelessregister} = ["function", [ "map", "string", "any"], ["map", "string", "any"], ["map", "string", "any"]]; }
sub statelessregister
@@ -192,7 +205,6 @@
my $self = shift;
my $ctx = shift;
my $arguments = shift;
- my $SRregisterFlagFile = '/var/lib/yastws/registration_successful';
unless ( defined $ctx && ref($ctx) eq "HASH" )
{
@@ -200,34 +212,30 @@
'contexterror' => '1' };
}
- # check if the system is still initialized - otherwise run init_ctx again
- unless ( defined $global_ctx && ref($global_ctx) eq "HASH" && exists $global_ctx->{debug} )
- {
- # not initialized - need to reinitialize
-
- # 1. proxy - fixed proxy settings (bnc#626965)
- if ( exists $ctx->{'proxy-http_proxy'} || exists $ctx->{'proxy-https_proxy'} )
- {
- my $http_proxy = $ctx->{'proxy-http_proxy'} || undef;
- my $https_proxy = $ctx->{'proxy-https_proxy'} || undef;
- $self->set_proxy($http_proxy, $https_proxy);
- delete $ctx->{'proxy-http_proxy'};
- delete $ctx->{'proxy-https_proxy'};
- }
-
- # 2. registration context
- $self->init_ctx($ctx);
- my $init_err = $self->get_errorcode();
-
- unless ($init_err == 0)
- {
- # init failed
- return { 'error' => 'The initialization of the registration failed.'
- ,'initerror' => $init_err
- ,'errorcode' => 199
- };
+ # always do a fresh init of proxy and context - otherwise old cached wrong data may be used
+ # 1. proxy - fixed proxy settings (bnc#626965)
+ $self->unset_proxy();
+ if ( exists $ctx->{'proxy-http_proxy'} || exists $ctx->{'proxy-https_proxy'} )
+ {
+ my $http_proxy = $ctx->{'proxy-http_proxy'} || undef;
+ my $https_proxy = $ctx->{'proxy-https_proxy'} || undef;
+ $self->set_proxy($http_proxy, $https_proxy);
+ delete $ctx->{'proxy-http_proxy'};
+ delete $ctx->{'proxy-https_proxy'};
+ }
+
+ # 2. registration context
+ $self->init_ctx($ctx);
+ my $init_err = $self->get_errorcode();
+
+ unless ($init_err == 0)
+ {
+ # init failed
+ return { 'error' => 'The initialization of the registration failed.'
+ ,'initerror' => $init_err
+ ,'errorcode' => 199
+ };
}
- }
# set arguments
# must be set one for one, otherwise other data would be overwritten
@@ -264,6 +272,9 @@
,'manualurl' => $manualurl
};
+ # we had a new registration process - so we reset the flag files
+ $self->removeregisteredflag();
+
if ( $exitcode == 0 )
{
# successful registration, so we need to save the last ZMD config
@@ -296,9 +307,7 @@
${$regret}{'tasklist'} = XMLout( {'item' => $tasklist}, rootname => 'tasklist', KeyAttr => { item => "+ALIAS", catalog => "+ALIAS" }, NoAttr => 1);
# write flagfile for successful registration
- open(FLAGFILE, "> $SRregisterFlagFile");
- print FLAGFILE localtime();
- close FLAGFILE;
+ $self->setregisteredflag(1);
# to be on the safe side for a following registration request, we need to delete the context data
$self->del_ctx();
@@ -350,7 +359,6 @@
my $SRconf = '/etc/suseRegister.conf';
my $SRcert = '/etc/ssl/certs/registration-server.pem';
my $SRcredentials = '/etc/zypp/credentials.d/NCCcredentials';
- my $SRregisterFlagFile = '/var/lib/yastws/registration_successful';
my $url = undef;
my $cert = undef;
@@ -386,7 +394,7 @@
}
# read the guid
- if ( -e $SRcredentials && -e $SRregisterFlagFile )
+ if ( -e $SRcredentials && $self->getregisteredflag() )
{
if (open(CRED, "< $SRcredentials") )
{
@@ -406,7 +414,7 @@
$guid = '' unless defined $guid;
# delete a flagfile that might be still there if no guid is found
- unlink($SRregisterFlagFile) if $guid eq '';
+ $self->removeregisteredflag() if $guid eq '';
return { "regserverurl" => $url,
"regserverca" => $cert,
@@ -495,6 +503,87 @@
return $success;
}
+
+#
+# setregisteredflag
+#
+# Write flagfile to identify a successful registration
+# Note: this is only a good guess, only the registration server knows about the status
+# (bnc#634026)
+#
+sub setregisteredflag()
+{
+ my $self = shift;
+ my $status = shift;
+ my $written = 0;
+
+ my $status_str = time();
+ $status_str = '' unless defined $status;
+
+
+ # write flagfile for successful registration
+ if ( -d $FFgeneric_dir )
+ {
+ if ( ! -e $FFgeneric || defined $status )
+ {
+ open( FFG, "> $FFgeneric" );
+ print FFG "$status_str";
+ close FFG;
+ }
+ $written = 1;
+ }
+
+ # this is the old location - will be obsoleted in follwing releases
+ if ( -d $FFwebyast_dir )
+ {
+ if ( ! -e $FFwebyast || defined $status )
+ {
+ open( FFW, "> $FFwebyast" );
+ print FFW "$status_str";
+ close FFW;
+ }
+ $written = 1;
+ }
+
+ return $written;
+}
+
+#
+# remove both registration flag files
+#
+# Remove flagfiles that identify a successful registration
+# Note: this is only a good guess, only the registration server knows about the status
+# (bnc#634026)
+#
+sub removeregisteredflag()
+{
+ my $self = shift;
+ unlink($FFgeneric);
+ unlink($FFwebyast);
+}
+
+#
+# getregisteredflag status
+#
+#
+# Get flagfile status to identify a successful registration
+# Note: this is only a good guess, only the registration server knows about the status
+# (bnc#634026)
+#
+sub getregisteredflag()
+{
+ my $self = shift;
+
+ if ( -e $FFgeneric || -e $FFwebyast )
+ {
+ # write them if only one is found
+ $self->setregisteredflag(undef);
+ return 1;
+ }
+ return 0;
+}
+
+
#
# check catalogs
#
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
Author: jdsn
Date: Sat Aug 28 00:50:16 2010
New Revision: 62436
URL: http://svn.opensuse.org/viewcvs/yast?rev=62436&view=rev
Log:
fix registration status detection, common flag file (bnc#634026)
fix proxy settings for WebYaST registrations (bnc#626965)
2.17.35
Modified:
branches/SuSE-Code-11-SP1-Branch/registration/VERSION
branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes
branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp
branches/SuSE-Code-11-SP1-Branch/registration/src/modules/YSR.pm
Modified: branches/SuSE-Code-11-SP1-Branch/registration/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/regis…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/registration/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/registration/VERSION Sat Aug 28 00:50:16 2010
@@ -1 +1 @@
-2.17.34
+2.17.35
Modified: branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/regis…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes Sat Aug 28 00:50:16 2010
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri Aug 27 20:33:46 CEST 2010 - jdsn(a)suse.de
+
+- fix registration status detection, common flag file (bnc#634026)
+- fix proxy settings for WebYaST registrations (bnc#626965)
+- 2.17.35
+
+-------------------------------------------------------------------
Fri Aug 20 18:01:17 CEST 2010 - jdsn(a)suse.de
- use correct error code for backend init errors (bnc#633183)
Modified: branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/regis…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp Sat Aug 28 00:50:16 2010
@@ -1540,8 +1540,9 @@
if ( initialSRstatus == 0 )
{
y2milestone("SuseRegister returned with status: %1", initialSRstatus);
- // touch webyast flag file to show in webyast that this machine is already registered
- SCR::Execute(.target.bash, sformat(" [ -d /var/lib/yastws ] && touch /var/lib/yastws/enable_SLM_webyast_registration_workaround "));
+ // touch webyast flag file to show in webyast that this machine is already registered (bnc#634026)
+ SCR::Execute(.target.bash, " [ -d /var/lib/yastws ] && date +%s > /var/lib/yastws/registration_successful " );
+ SCR::Execute(.target.bash, " [ -d /var/lib/suseRegister ] && date +%s > /var/lib/suseRegister/y2_registration_successful " );
}
Modified: branches/SuSE-Code-11-SP1-Branch/registration/src/modules/YSR.pm
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/regis…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/registration/src/modules/YSR.pm (original)
+++ branches/SuSE-Code-11-SP1-Branch/registration/src/modules/YSR.pm Sat Aug 28 00:50:16 2010
@@ -20,6 +20,12 @@
my $global_ctx = {};
+# flag files for registration status
+my $FFwebyast_dir = '/var/lib/yastws';
+my $FFwebyast = $FFwebyast_dir.'/registration_successful';
+my $FFgeneric_dir = '/var/lib/suseRegister';
+my $FFgeneric = $FFgeneric_dir.'/y2_registration_successful';
+
# set the PATH in the perl environment (bnc#621914)
# otherwise it is empty in system calls
$ENV{PATH}="/usr/bin:/sbin:/usr/sbin:/bin";
@@ -185,6 +191,13 @@
}
}
+BEGIN { $TYPEINFO{unset_proxy} = ["function", "void"]; }
+sub unset_proxy
+{
+ my $self = shift;
+ delete $ENV{http_proxy};
+ delete $ENV{https_proxy};
+}
BEGIN { $TYPEINFO{statelessregister} = ["function", [ "map", "string", "any"], ["map", "string", "any"], ["map", "string", "any"]]; }
sub statelessregister
@@ -192,7 +205,6 @@
my $self = shift;
my $ctx = shift;
my $arguments = shift;
- my $SRregisterFlagFile = '/var/lib/yastws/registration_successful';
unless ( defined $ctx && ref($ctx) eq "HASH" )
{
@@ -200,32 +212,30 @@
'contexterror' => '1' };
}
- # check if the system is still initialized - otherwise run init_ctx again
- unless ( defined $global_ctx && ref($global_ctx) eq "HASH" && exists $global_ctx->{debug} )
- {
- # not initialized - need to reinitialize
-
- # 1. proxy
- if ( exists $ctx->{'proxy'} && ref($ctx->{'proxy'}) eq "HASH" )
- {
- my $http = $ctx->{'proxy'}{'http_proxy'} || undef;
- my $https = $ctx->{'proxy'}{'https_proxy'} || undef;
- $self->set_proxy($http, $https);
- }
-
- # 2. registration context
- $self->init_ctx($ctx);
- my $init_err = $self->get_errorcode();
-
- unless ($init_err == 0)
- {
- # init failed
- return { 'error' => 'The initialization of the registration failed.'
- ,'initerror' => $init_err
- ,'errorcode' => 199
- };
+ # always do a fresh init of proxy and context - otherwise old cached wrong data may be used
+ # 1. proxy - fixed proxy settings (bnc#626965)
+ $self->unset_proxy();
+ if ( exists $ctx->{'proxy-http_proxy'} || exists $ctx->{'proxy-https_proxy'} )
+ {
+ my $http_proxy = $ctx->{'proxy-http_proxy'} || undef;
+ my $https_proxy = $ctx->{'proxy-https_proxy'} || undef;
+ $self->set_proxy($http_proxy, $https_proxy);
+ delete $ctx->{'proxy-http_proxy'};
+ delete $ctx->{'proxy-https_proxy'};
+ }
+
+ # 2. registration context
+ $self->init_ctx($ctx);
+ my $init_err = $self->get_errorcode();
+
+ unless ($init_err == 0)
+ {
+ # init failed
+ return { 'error' => 'The initialization of the registration failed.'
+ ,'initerror' => $init_err
+ ,'errorcode' => 199
+ };
}
- }
# set arguments
# must be set one for one, otherwise other data would be overwritten
@@ -262,6 +272,9 @@
,'manualurl' => $manualurl
};
+ # we had a new registration process - so we reset the flag files
+ $self->removeregisteredflag();
+
if ( $exitcode == 0 )
{
# successful registration, so we need to save the last ZMD config
@@ -294,9 +307,7 @@
${$regret}{'tasklist'} = XMLout( {'item' => $tasklist}, rootname => 'tasklist', KeyAttr => { item => "+ALIAS", catalog => "+ALIAS" }, NoAttr => 1);
# write flagfile for successful registration
- open(FLAGFILE, "> $SRregisterFlagFile");
- print FLAGFILE localtime();
- close FLAGFILE;
+ $self->setregisteredflag(1);
# to be on the safe side for a following registration request, we need to delete the context data
$self->del_ctx();
@@ -348,7 +359,6 @@
my $SRconf = '/etc/suseRegister.conf';
my $SRcert = '/etc/ssl/certs/registration-server.pem';
my $SRcredentials = '/etc/zypp/credentials.d/NCCcredentials';
- my $SRregisterFlagFile = '/var/lib/yastws/registration_successful';
my $url = undef;
my $cert = undef;
@@ -384,7 +394,7 @@
}
# read the guid
- if ( -e $SRcredentials && -e $SRregisterFlagFile )
+ if ( -e $SRcredentials && $self->getregisteredflag() )
{
if (open(CRED, "< $SRcredentials") )
{
@@ -404,7 +414,7 @@
$guid = '' unless defined $guid;
# delete a flagfile that might be still there if no guid is found
- unlink($SRregisterFlagFile) if $guid eq '';
+ $self->removeregisteredflag() if $guid eq '';
return { "regserverurl" => $url,
"regserverca" => $cert,
@@ -493,6 +503,87 @@
return $success;
}
+
+#
+# setregisteredflag
+#
+# Write flagfile to identify a successful registration
+# Note: this is only a good guess, only the registration server knows about the status
+# (bnc#634026)
+#
+sub setregisteredflag()
+{
+ my $self = shift;
+ my $status = shift;
+ my $written = 0;
+
+ my $status_str = time();
+ $status_str = '' unless defined $status;
+
+
+ # write flagfile for successful registration
+ if ( -d $FFgeneric_dir )
+ {
+ if ( ! -e $FFgeneric || defined $status )
+ {
+ open( FFG, "> $FFgeneric" );
+ print FFG "$status_str";
+ close FFG;
+ }
+ $written = 1;
+ }
+
+ # this is the old location - will be obsoleted in follwing releases
+ if ( -d $FFwebyast_dir )
+ {
+ if ( ! -e $FFwebyast || defined $status )
+ {
+ open( FFW, "> $FFwebyast" );
+ print FFW "$status_str";
+ close FFW;
+ }
+ $written = 1;
+ }
+
+ return $written;
+}
+
+#
+# remove both registration flag files
+#
+# Remove flagfiles that identify a successful registration
+# Note: this is only a good guess, only the registration server knows about the status
+# (bnc#634026)
+#
+sub removeregisteredflag()
+{
+ my $self = shift;
+ unlink($FFgeneric);
+ unlink($FFwebyast);
+}
+
+#
+# getregisteredflag status
+#
+#
+# Get flagfile status to identify a successful registration
+# Note: this is only a good guess, only the registration server knows about the status
+# (bnc#634026)
+#
+sub getregisteredflag()
+{
+ my $self = shift;
+
+ if ( -e $FFgeneric || -e $FFwebyast )
+ {
+ # write them if only one is found
+ $self->setregisteredflag(undef);
+ return 1;
+ }
+ return 0;
+}
+
+
#
# check catalogs
#
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org