From 778411622230a82adbd7f561443ff87b46000844 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 6 Aug 2009 07:27:33 +0000 Subject: [PATCH] Fixed Lvm disks in FAI partition handling. -Display correct devices in available list. -Fixed info list of used partitions. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13975 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiDiskEntry.inc | 24 ++++++++++++++----- .../fai/admin/fai/class_faiPartitionTable.inc | 2 +- gosa-plugins/fai/admin/fai/faiDiskEntry.tpl | 3 ++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc index 48815b680..a3819d5ce 100644 --- a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc @@ -278,18 +278,30 @@ class faiDiskEntry extends plugin $objs = $disks; foreach($disks as $disk){ foreach($disk['partitions'] as $id => $part){ - $objs[$disk['cn']] = $part; + $part['parentDisk'] = $disk; + $objs[$part['cn']] = $part; } } $list = array(); foreach($this->lvmDevices as $device){ - $list[$device] = $device; - if(isset($objs[$device]['FAIpartitionSize'])){ - $list[$device].= _("Size").": "; - $list[$device].= $objs[$device]['FAIpartitionSize']; + $str = $device; + $str = preg_replace("/ /"," ",str_pad($str,20," ")); + + if(isset($objs[$device])){ + + if(isset($objs[$device]['FAIpartitionSize'])){ + if($objs[$device]['parentDisk']['FAIdiskType'] == "raid"){ + $str .= _("Disks").": "; + $str .= $objs[$device]['FAIpartitionSize']; + }else{ + $str .= _("Size").": "; + $str .= $objs[$device]['FAIpartitionSize']; + } + } } + $list[$device] = $str; } return($list); } @@ -299,7 +311,7 @@ class faiDiskEntry extends plugin $array = array(); foreach($this->parent->disks as $disk){ foreach($disk['partitions'] as $key => $part){ - $name = $disk['cn']; + $name = $part['cn']; if(!isset($this->lvmDevices[$name])){ $array[$name] = $name; } diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index dd66cffbc..492d3c882 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -137,7 +137,7 @@ class faiPartitionTable extends plugin if ($this->FAIpartitionMethod == "setup-storage") { if(isset($_POST['AddDisk'])) $type = "disk"; if(isset($_POST['AddRaid'])) $type = "raid"; - if(isset($_POST['AddAddVolgroup'])) $type = "lvm"; + if(isset($_POST['AddVolgroup'])) $type = "lvm"; $this->dialog = new faiDiskEntry($this->config,$this->dn,$this, array(),$type); } else { $this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$this); diff --git a/gosa-plugins/fai/admin/fai/faiDiskEntry.tpl b/gosa-plugins/fai/admin/fai/faiDiskEntry.tpl index 3b489d368..7e25562fa 100644 --- a/gosa-plugins/fai/admin/fai/faiDiskEntry.tpl +++ b/gosa-plugins/fai/admin/fai/faiDiskEntry.tpl @@ -70,7 +70,8 @@

{t}Combined physical partitions{/t}

- {html_options options=$plist}
-- 2.30.2