From bbb8900dc7676ee039cd0b45b7f99e65da42a883 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 20 Mar 2008 07:39:05 +0000 Subject: [PATCH] Update workstation startup -Use SI server for FAI classes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9952 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/class_workstationStartup.inc | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index 6e3c55301..5485aaafb 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -825,27 +825,25 @@ class workstartup extends plugin plugin::save(); unset( $this->attrs['FAIrelease'] ); - $str = ""; /* Skip FAI attribute handling if not necessary */ if($this->fai_activated){ if($this->FAIdebianMirror == "inherited"){ - $this->attrs['FAIclass'] = $this->attrs['FAIrelease'] = $this->attrs['FAIdebianMirror'] = array(); + $this->attrs['FAIclass'] = $this->attrs['FAIrelease'] = $this->attrs['FAIdebianMirror'] = array(); }else{ foreach($this->FAIclass as $class){ $str .= $class." "; } - $str .= ":" . $this->FAIrelease; - $this->attrs['FAIclass']= ""; - $this->attrs['FAIclass']= trim($str); - + $str = trim($str); if(empty($this->attrs['FAIclass'])){ $this->attrs['FAIclass'] = array(); + }else{ + $this->attrs['FAIclass']= $str.":".$this->FAIrelease; } } } - + /* Add missing arrays */ foreach (array("gotoFilesystem", "gotoAutoFs", "gotoModules") as $val){ if (isset ($this->$val) && count ($this->$val) != 0){ @@ -1071,7 +1069,7 @@ class workstartup extends plugin */ function update_fai_cache($first_call = FALSE) { - $force = TRUE; + $force = FALSE; $start = microtime(TRUE); @@ -1130,15 +1128,16 @@ class workstartup extends plugin */ $o_queue = new gosaSupportDaemon(); $tmp = $o_queue->FAI_get_classes($release); + $this->cache['CLASSES'][$release] = array(); if($o_queue->is_error()){ msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG); }else{ foreach($tmp as $entry){ - $this->cache['CLASSES'][$release][$entry['CLASS']] = $this->analyse_fai_object($entry); + $class = $entry['CLASS']; + $this->cache['CLASSES'][$release][$class] = $this->analyse_fai_object($entry); } } - /* Add object caught from external hook */ $lines= $this->GetHookElements(); @@ -1160,7 +1159,7 @@ class workstartup extends plugin if($release_c == $release){ $this->cache['SERVERS'][$url][$release_c]=$release_c; $this->cache['SERVERS']['auto'][$release_c]=$release_c; - foreach ($classes as $class){ + foreach ($classes_c as $class){ if ($class != ""){ $this->cache['CLASSES'][$release_c][$class]= array(); } @@ -1171,6 +1170,7 @@ class workstartup extends plugin } } } +# echo sprintf("Took %.6f
",microtime(1) - $start); } -- 2.30.2