From ec3a3e61feb89573c5719f1c4d720bd2c78af8ba Mon Sep 17 00:00:00 2001 From: janw Date: Tue, 11 Mar 2008 14:58:21 +0000 Subject: [PATCH] Report unit tag failures to client. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9680 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/client/events/corefunctions.pm | 5 +++++ gosa-si/modules/SIPackages.pm | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gosa-si/client/events/corefunctions.pm b/gosa-si/client/events/corefunctions.pm index 59337b4aa..663daa89b 100644 --- a/gosa-si/client/events/corefunctions.pm +++ b/gosa-si/client/events/corefunctions.pm @@ -121,6 +121,11 @@ sub registered { @{$msg_hash->{'ldap_available'}}[0] eq "true") { print $opts_file_FH "LDAP_AVAILABLE=\"true\"\n"; } + if(defined(@{$msg_hash->{'error'}})) { + my $errormsg= @{$msg_hash->{'error'}}[0]; + print $opts_file_FH "GOSA_SI_ERROR=\"$errormsg\"\n"; + &write_to_file($errormsg, $fai_logpath); + } close($opts_file_FH); my $out_msg = &create_xml_string($out_hash); diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index 9f250969e..787baff7f 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -580,14 +580,16 @@ sub here_i_am { # give the new client his ldap config # Workaround: Send within the registration response, if the client will get an ldap config later my $new_ldap_config_out = &new_ldap_config($source); - if( $new_ldap_config_out ) { - &add_content2xml_hash($out_hash, "ldap_available", "true"); - } + if( $new_ldap_config_out && (!($new_ldap_config_out =~ /error/ ))) { + &add_content2xml_hash($out_hash, "ldap_available", "true"); + } elsif ($new_ldap_config_out && $new_ldap_config_out =~ /error/){ + &add_content2xml_hash($out_hash, "error", $new_ldap_config_out); + } my $register_out = &create_xml_string($out_hash); push(@out_msg_l, $register_out); # Really send the ldap config - if( $new_ldap_config_out ) { + if( $new_ldap_config_out (!($new_ldap_config_out =~ /error/))) { push(@out_msg_l, $new_ldap_config_out); } @@ -791,13 +793,13 @@ sub new_ldap_config { #$mesg->code && die $mesg->error; if($mesg->code) { &main::daemon_log($mesg->error, 1); - return; + return "error-unit-tag-count-0"; } # Sanity check if ($mesg->count != 1) { &main::daemon_log("WARNING: cannot find administrative unit for client with tag $unit_tag", 1); - return; + return "error-unit-tag-count-".$mesg->count; } $entry= $mesg->entry(0); -- 2.30.2