From 94b1a89606ea838a4f6af2858da154b4124dcbcf Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 5 Mar 2008 17:49:48 +0000 Subject: [PATCH] Added activate/lock actions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9374 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/server/events/gosaTriggered.pm | 29 +++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index eb081e099..d84b16a9f 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -17,6 +17,8 @@ my @events = ( "trigger_action_localboot", "trigger_action_faireboot", "trigger_action_reboot", + "trigger_action_activate", + "trigger_action_lock", "trigger_action_halt", "trigger_action_update", "trigger_action_reinstall", @@ -297,6 +299,8 @@ sub trigger_action_faireboot { $msg =~ s/
gosa_trigger_action_faireboot<\/header>/
trigger_action_faireboot<\/header>/; push(@out_msg_l, $msg); + change_goto_state('locked', \@{$msg_hash->{target}}); + # delete all jobs from jobqueue which correspond to fai my $sql_statement = "DELETE FROM $main::job_queue_tn WHERE (macaddress='$macaddress' AND ". "status='processing' AND headertag='trigger_action_install')"; @@ -306,6 +310,29 @@ sub trigger_action_faireboot { } +sub trigger_action_lock { + my ($msg, $msg_hash) = @_; + my $macaddress = @{$msg_hash->{target}}[0]; + my $source = @{$msg_hash->{source}}[0]; + + change_goto_state('locked', \@{$msg_hash->{target}}); + + my @out_msg_l; + return @out_msg_l; +} + + +sub trigger_action_activate { + my ($msg, $msg_hash) = @_; + my $macaddress = @{$msg_hash->{target}}[0]; + my $source = @{$msg_hash->{source}}[0]; + + change_goto_state('active', \@{$msg_hash->{target}}); + + my @out_msg_l; + return @out_msg_l; +} + sub trigger_action_localboot { my ($msg, $msg_hash) = @_; @@ -524,7 +551,7 @@ sub change_goto_state { $search.= ")"; # If there's any host inside of the search string, procress them - if ($search !=~ /macAddress/){ + if (!($search =~ /macAddress/)){ return; } -- 2.30.2