From 032e09dd7aba6b584b55daa165cc647215b6c582 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 17 Mar 2008 10:33:35 +0000 Subject: [PATCH] Updated system Management. -Only add triggeredd events, if not already in process git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9894 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_systemManagement.inc | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index f56c0b574..6283f5c1b 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -519,6 +519,27 @@ class systems extends plugin } $events = DaemonEvent::get_event_types(SYSTEM_EVENT); $type = preg_replace("/^[a-z]*_event_/","",$s_action); + $o_queue = new gosaSupportDaemon(); + + /* Skip installation or update trigerred events, + * if this entry is currently processing. + */ + if(preg_match("/trigger_event/",$s_action) && in_array($type,array("DaemonEvent_reinstall","DaemonEvent_update"))){ + foreach($mac as $key => $mac_address){ + foreach($o_queue->get_entries_by_mac(array($mac_address)) as $entry){ + + $entry['STATUS'] = strtoupper($entry['STATUS']); + if($entry['STATUS'] == "PROCESSING" && + isset($events['QUEUED'][$entry['HEADERTAG']]) && + in_array($events['QUEUED'][$entry['HEADERTAG']],array("DaemonEvent_reinstall","DaemonEvent_update"))){ + unset($mac[$key]); + + new log("security","systems/".get_class($this),"",array(),"Skip adding 'DaemonEvent::".$type."' for mac '".$mac_address."', there is already a job in progress."); + break; + } + } + } + } /* Prepare event to be added */ -- 2.30.2