From 1678e943f2d883e3a01d9eeaef76f69f61b4ff2c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 11 Mar 2008 09:09:12 +0000 Subject: [PATCH] Updated goto -Send localboot when reinstall wasn't started yet git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9653 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/addons/goto/class_gotomasses.inc | 21 +++++++++++++++++++ .../addons/goto/events/class_DaemonEvent.inc | 8 +++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc index c743130e0..e168b880e 100644 --- a/gosa-plugins/goto/addons/goto/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/goto/class_gotomasses.inc @@ -220,6 +220,27 @@ class gotomasses extends plugin /* Remove specified tasks */ if(count($this->ids_to_remove) && isset($_POST['delete_multiple_confirm'])){ + + /* Reboot hosts with not yet startet installations and timestamps in the past + */ + timezone::get_default_timezone(); + foreach($this->ids_to_remove as $id){ + $entry = $this->o_queue->get_entries_by_id(array($id)); + if(isset($entry['ANSWER1'])){ + $entry = $entry['ANSWER1']; + if( $entry['STATUS'] == "wating" && + $entry['HEADERTAG'] == "trigger_action_reinstall"){ + $evt = new DaemonEvent_reinstall($this->config,$entry); + if($evt->get_timestamp(FALSE) < time()){ + $r_evt = new DaemonEvent_localboot($this->config); + $r_evt->add_targets(array($entry['MACADDRESS'])); + $r_evt->set_type(TRIGGERED_EVENT); + $this->o_queue->append($r_evt); + } + } + } + } + $this->o_queue->remove_entries($this->ids_to_remove); $this->save(); } diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc index c852cfafb..bf231e771 100644 --- a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc +++ b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc @@ -455,9 +455,13 @@ class DaemonEvent /*! \brief Returns the event timestamp in GOsa daemon format. @return Returns the event timestamp (20081231120000) */ - public function get_timestamp() + public function get_timestamp($si_type = TRUE) { - return($this->_timestamp_to_event($this->timestamp)); + if($si_type){ + return($this->_timestamp_to_event($this->timestamp)); + }else{ + return($this->timestamp); + } } -- 2.30.2