From bb465dfee883db917af0960a52ce5d91faaa0f3a Mon Sep 17 00:00:00 2001 From: rettenbe Date: Thu, 30 Oct 2008 15:25:18 +0000 Subject: [PATCH] status update of job in job_queue with jobdb_id was triggered with wrong sql statement git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12833 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/server/events/gosaTriggered.pm | 46 +++++++++++++------------- gosa-si/server/events/mailqueue_com.pm | 4 +-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index 3c8fbeef1..943a727b5 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -95,7 +95,7 @@ sub send_user_msg { # keep job queue uptodate if necessary my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -157,7 +157,7 @@ sub recreate_fai_server_db { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -177,7 +177,7 @@ sub recreate_fai_release_db { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -197,7 +197,7 @@ sub recreate_packages_list_db { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -218,7 +218,7 @@ sub get_login_usr_for_client { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -245,7 +245,7 @@ sub get_client_for_login_usr { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -276,7 +276,7 @@ sub ping { my ($sql, $res); if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -396,7 +396,7 @@ sub detect_hardware { my $target = @{$msg_hash->{target}}[0]; my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -422,7 +422,7 @@ sub trigger_reload_syslog_config { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -445,7 +445,7 @@ sub trigger_reload_ntp_config { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -463,7 +463,7 @@ sub trigger_reload_ldap_config { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -485,7 +485,7 @@ sub set_activated_for_installation { # update status of job my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -533,7 +533,7 @@ sub trigger_action_lock { &main::change_goto_state('locked', \@{$msg_hash->{macaddress}}, $session_id); my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -551,7 +551,7 @@ sub trigger_action_activate { &main::change_goto_state('active', \@{$msg_hash->{macaddress}}, $session_id); my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -572,7 +572,7 @@ sub trigger_action_localboot { &main::change_fai_state('localboot', \@{$msg_hash->{macaddress}}, $session_id); my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -588,7 +588,7 @@ sub trigger_action_halt { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -605,7 +605,7 @@ sub trigger_action_reboot { &main::change_fai_state('reboot', \@{$msg_hash->{macaddress}}, $session_id); my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -622,7 +622,7 @@ sub trigger_action_memcheck { &main::change_fai_state('memcheck', \@{$msg_hash->{macaddress}}, $session_id); my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -670,7 +670,7 @@ sub trigger_action_instant_update { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -692,7 +692,7 @@ sub trigger_action_sysinfo { &main::change_fai_state('sysinfo', \@{$msg_hash->{macaddress}}, $session_id); my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -707,7 +707,7 @@ sub new_key_for_client { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -723,7 +723,7 @@ sub trigger_action_rescan { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -740,7 +740,7 @@ sub trigger_action_wake { my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } diff --git a/gosa-si/server/events/mailqueue_com.pm b/gosa-si/server/events/mailqueue_com.pm index 87642ebd0..d464db371 100644 --- a/gosa-si/server/events/mailqueue_com.pm +++ b/gosa-si/server/events/mailqueue_com.pm @@ -87,7 +87,7 @@ sub mailqueue_query { my ($sql, $res); if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } @@ -170,7 +170,7 @@ sub mailqueue_header { my ($sql, $res); if( defined $jobdb_id) { - my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=jobdb_id"; + my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id"; &main::daemon_log("$session_id DEBUG: $sql_statement", 7); my $res = $main::job_db->exec_statement($sql_statement); } -- 2.30.2