From af36a29a7d504aa98b79ce2882b856dd0cbd6ee2 Mon Sep 17 00:00:00 2001 From: janw Date: Tue, 19 Feb 2008 13:49:40 +0000 Subject: [PATCH] Added message from ldap to error. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8956 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/modules/SIPackages.pm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index eb454e4e8..83df82a61 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -914,17 +914,20 @@ sub process_detected_hardware { $entry->add("objectClass" => "gosaAdministrativeUnit"); $entry->add("gosaUnitTag" => $gosa_unit_tag); } - if($entry->update($ldap)) { + my $res=$entry->update($ldap); + if(defined($res->{'errorMessage'}) && + length($res->{'errorMessage'}) >0) { + &main::daemon_log("There was a problem adding the entries to LDAP:", 1); + &main::daemon_log($res->{'errorMessage'}, 1); + return; + } else { # Fill $mesg again $mesg = $ldap->search( base => $ldap_base, scope => 'sub', filter => "(&(objectClass=GOhard)(|(macAddress=$macaddress)(dhcpHWaddress=ethernet $macaddress)))" ); - } else { - &main::daemon_log("ERROR: There was a problem adding the entry", 1); } - } if($mesg->count == 1) { @@ -952,10 +955,14 @@ sub process_detected_hardware { $entry->add($attribute => $array_entry); } } - } - if($entry->update($ldap)) { + my $res=$entry->update($ldap); + if(defined($res->{'errorMessage'}) && + length($res->{'errorMessage'}) >0) { + &main::daemon_log("There was a problem adding the entries to LDAP:", 1); + &main::daemon_log($res->{'errorMessage'}, 1); + } else { &main::daemon_log("Added Hardware configuration to LDAP", 4); } -- 2.30.2