Code

Added message from ldap to error.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Feb 2008 13:49:40 +0000 (13:49 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Feb 2008 13:49:40 +0000 (13:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8956 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/modules/SIPackages.pm

index eb454e4e8e74d8ef8667f364be14e719387be66c..83df82a61ff60d1547de70e9e56cc02d0676ddec 100644 (file)
@@ -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);
                }