summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2e346a4)
raw | patch | inline | side by side (parent: 2e346a4)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 Aug 2009 11:28:02 +0000 (11:28 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 Aug 2009 11:28:02 +0000 (11:28 +0000) |
-Added checks for raid devices.
-Updated listing of raid devices.
-Fixed saving
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13979 594d385d-05f5-0310-b6e9-bd551577e9d8
-Updated listing of raid devices.
-Fixed saving
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13979 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
index c319fc3924195d0ed36ef021adfc3ba9578ba4f5..05cfb007c266ecc77e19499d6d8906dbbf000eab 100644 (file)
$new_partition = $this->dialog->save();
$msgs = $this->dialog->check();
- $msgs = array_merge($this->check_disks($new_partition));
+ $msgs = array_merge($msgs,$this->check_disks($new_partition));
if(!count($msgs)){
$this->updatePartition($new_partition);
}
}
+ /* Check if we've to update lvm compilations.
+ */
+ if($this->FAIdiskType == "raid"){
+ $part['cn'] = 'md'.$part['FAIpartitionNr'];
+ }
+
$this->partitions[$part['FAIpartitionNr']] = $part;
}
if($this->FAIdiskType == "lvm"){
$fields = array($cn,$desc,$mntp,$opt,$size, $action);
+ }elseif($this->FAIdiskType == "raid"){
+
+ $raid_str = $part['FAIpartitionType']." (".$part['FAIpartitionSize'].")";
+ $raid = array("string" => $raid_str);
+
+ $fields = array($cn,$desc,$raid,$mntp,$opt,$action);
}else{
$fields = array($number,$desc,$type,$mntp,$opt,$size,$action);
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartition.inc b/gosa-plugins/fai/admin/fai/class_faiPartition.inc
index 481df78319dfc51199c04e380603815c79af1184..f8a9a121514301de498068fb15049ef5989fa4e3 100644 (file)
$name = preg_replace("/:.*$/","",$disk);
$spare = preg_match("/:spare/",$disk);
$missing = preg_match("/:missing/",$disk);
- $this->raidDevices[$name] =
- array(
- "name" => $name,
- "spare" => $spare,
- "missing" => $missing);
+ if(!empty($name)){
+ $this->raidDevices[$name] =
+ array(
+ "name" => $name,
+ "spare" => $spare,
+ "missing" => $missing);
+ }
}
}
}
$list = array();
foreach($this->raidDevices as $device){
- $list[$device['name']] = $device['name'];
-
+ $str = $name = $device['name'];
+ $str = str_pad($str,25," ");
if(isset($objs[$device['name']]['FAIpartitionSize'])){
- $list[$device['name']].= _("Size").": ";
- $list[$device['name']].= $objs[$device['name']]['FAIpartitionSize'];
+ $str .= _("Size").": ";
+ $str .= $objs[$device['name']]['FAIpartitionSize'];
}
-
- $list[$device['name']].= " "._("Options").": ";
+ $str = str_pad($str,60," ");
+ $opt = "";
if($device['spare']){
- $list[$device['name']].= " "._("spare")." ";
+ $opt.= " "._("spare")." ";
}
if($device['missing']){
- $list[$device['name']].= " "._("missing")." ";
+ $opt.= " "._("missing")." ";
}
+ if($opt){
+ $str .= " "._("Options").": ".$opt;
+ }
+ $str = str_pad($str,80," ");
+ $list[$name] = preg_replace("/ /"," ",$str);
}
return($list);
}
}
}
}
+
+ // Add raid checks
if($this->FAIdiskType == "raid"){
- #FIME raid checks missing
- echo "Add raid checks here, disk combinations are not verified right now.";
+ if(count($this->raidDevices) < 2){
+ $msgs[] = _("Raid arrays must contain at least two partitions!");
+ }else if($this->FAIpartitionType == "raid0" && count($this->raidDevices) != 2){
+ $msgs[] = _("Raid 0 arrays can only be realized with a combination of two partitions!");
+ }
}
// check mount point
diff --git a/gosa-plugins/fai/admin/fai/faiPartition.tpl b/gosa-plugins/fai/admin/fai/faiPartition.tpl
index cc4bd9f2255d5c95bf4949e1684606cb20ce2e3c..e641c4733aeac3f98d65f669b24e0a2356fe875d 100644 (file)
<td colspan="4">
<h2>{t}Combined physical partitions{/t}</h2>
- <select name='physicalPartition' size=5 style="width:100%;">
+ <select name='physicalPartition' size=5 style="width:100%; font-family: monospace;">
{html_options options=$plist}
</select>
<br>