summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb1af61)
raw | patch | inline | side by side (parent: bb1af61)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 7 Aug 2009 13:12:35 +0000 (13:12 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 7 Aug 2009 13:12:35 +0000 (13:12 +0000) |
-Only display unsued partitions in raid editor.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14003 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14003 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/class_faiPartition.inc | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartition.inc b/gosa-plugins/fai/admin/fai/class_faiPartition.inc
index 059ebda2b7162e13b3b0b4b5c6c27d56ba9d4e60..673d263fa885f8fc1f6e02316a1fe595379903b7 100644 (file)
*/
function getPartitionList()
{
- $array = array();
+ $may = $used = array();
foreach($this->parent->parent->disks as $disk){
- if($disk['FAIdiskType'] != "raid"){
- foreach($disk['partitions'] as $key => $part){
+
+ // Skip ourselves
+ if($disk['cn'] == $this->parent->DISKcn) continue;
+
+ // Add partition from lvm combinations
+ if($disk['FAIdiskType'] == "lvm"){
+ $used = array_merge($used,$disk['FAIlvmDevice']);
+ }
+
+ foreach($disk['partitions'] as $key => $part){
+
+ // Add disks of raid arrays, to the used list.
+ if($disk['FAIdiskType'] == "raid"){
+ foreach(split(",",$part['FAIpartitionSize']) as $rDevice){
+ $used[] = preg_replace("/:.*$/i","",$rDevice);
+ }
+ }
+
+ // Collect all available disks
+ if($disk['FAIdiskType'] == "disk"){
$name = $part['cn'];
if(!isset($this->raidDevices[$name])){
- $array[$name] = $name." (".$disk['cn'].")";
+ $may[] = $name;
}
}
}
}
- return($array);
+
+ // Check which of the available disks are unused.
+ $ret = array();
+ foreach($may as $val){
+ if(!in_array($val,$used)){
+ $ret[$val] = $val;
+ }
+ }
+ return($ret);
}