summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5bdc9bd)
raw | patch | inline | side by side (parent: 5bdc9bd)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Nov 2008 10:12:19 +0000 (10:12 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Nov 2008 10:12:19 +0000 (10:12 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12921 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/server/events/gosaTriggered.pm | patch | blob | history |
index aaec74effca26710cb7ba202007f1663f949c951..0639c0213021022d351fafe021aaa6491f3bfbce 100644 (file)
my $dhcp_statement= (defined($msg_hash->{'dhcp'}))?@{$msg_hash->{'dhcp'}}[0]:undef;
my $jobdb_id= (defined($msg_hash->{'jobdb_id'}))?@{$msg_hash->{'jobdb_id'}}[0]:undef;
+ # Sanity check for base
+ if (ref($base) eq "HASH") {
+ # Incoming msg has a xml tag 'base' but no content
+ $base = undef;
+ }
+
# In case that the client is sleeping, wake it up
my %data = ( 'macaddress' => $mac );
my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data);
my $error = &main::send_msg_to_target($wake_msg, $host_name, $host_key, $header, $session_id);
}
-
-
my $ldap_handle = &main::get_ldap_handle();
my $ldap_entry;
my $ogroup_entry;
# To prevent replication problems just re-queue the job with 10 seconds in the future
my $moddn_result = $ldap_entry->update($ldap_handle);
if ($moddn_result->code() != 0) {
- &main::daemon_log("$session_id 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 = '".(&calc_timestamp(&get_time(), 'plus', 10))."' WHERE id = $jobdb_id");
- return undef;
+ my $error_string = "Moving the system with mac address '$mac' to new base '$base' failed (code '".$moddn_result->code()."') with '".$moddn_result->{'errorMessage'}."'!";
+ &main::daemon_log("$session_id ERROR: $error_string", 1);
+ my $sql = "UPDATE $main::job_queue_tn SET status='error', result='$error_string' WHERE id=$jobdb_id";
+ return undef;
} else {
&main::daemon_log("$session_id 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");