Code

Added activate/lock actions
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Mar 2008 17:49:48 +0000 (17:49 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Mar 2008 17:49:48 +0000 (17:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9374 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/server/events/gosaTriggered.pm

index eb081e0995f01be0316cfad538d9b6ea8c166ce1..d84b16a9f424d7b87fc22f2e2cbf4c662ac239cd 100644 (file)
@@ -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/<header>gosa_trigger_action_faireboot<\/header>/<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;
       }