From 1abde349b73e8d20258e38baba41ccb1ccf9d34c Mon Sep 17 00:00:00 2001 From: janw Date: Wed, 10 Sep 2008 14:32:56 +0000 Subject: [PATCH] Added checks. Added objectClass for new system. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12402 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/server/events/gosaTriggered.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index faf3915e4..abe30db02 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -861,6 +861,10 @@ sub trigger_activate_new { my $moddn_result = $ldap_entry->update($ldap_handle); if ($moddn_result->code() != 0) { &main::daemon_log("ERROR: Moving the system with mac address '$mac' to new base '$base' failed (code '".$moddn_result->code()."') with '".$moddn_result->{'errorMessage'}."'!", 1); + $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id"); + $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(10)."' WHERE id = $jobdb_id"); + return undef; + } else { &main::daemon_log("INFO: System with mac address '$mac' was moved to base '".$main::ldap_base."'! Re-queuing job.", 4); $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id"); $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(10)."' WHERE id = $jobdb_id"); @@ -886,7 +890,7 @@ sub trigger_activate_new { $ldap_entry= $ldap_mesg->pop_entry(); # Check for needed objectClasses my $oclasses = $ldap_entry->get_value('objectClass', asref => 1); - foreach my $oclass ("FAIobject", "GOhard") { + foreach my $oclass ("FAIobject", "GOhard", "gotoWorkstation") { if(!(scalar grep $_ eq $oclass, map {$_ => 1} @$oclasses)) { &main::daemon_log("Adding objectClass $oclass", 1); $ldap_entry->add( -- 2.30.2