summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbf34ff)
raw | patch | inline | side by side (parent: bbf34ff)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Jul 2009 13:31:18 +0000 (13:31 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Jul 2009 13:31:18 +0000 (13:31 +0000) |
-New disk couldn't be saved.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13967 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13967 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 a3db65c68744f36888bef07d08162cb09be6303a..aa0dec8a6900ba02a20c57e69dfa8cb1b789f38b 100644 (file)
{
if(!isset($part['FAIpartitionNr']) || $part['FAIpartitionNr'] == "undefined"){
$part['FAIpartitionNr'] = count($this->partitions) + 1;
- $part['cn'] = $this->cn.$part['FAIpartitionNr'];
+ $part['cn'] = $this->DISKcn.$part['FAIpartitionNr'];
}
+ $part['cn'] = $this->DISKcn.$part['FAIpartitionNr'];
$this->partitions[$part['FAIpartitionNr']] = $part;
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartition.inc b/gosa-plugins/fai/admin/fai/class_faiPartition.inc
index e3ed5dac8dd8bb6f2b900034f0f497eb7410d6b1..f4802d569176ac11ddc5a70af294a611f775b48d 100644 (file)
$this->parent = $parent;
$this->status = "new";
-
+ $this->FAIdiskType = $type;
+
+
// Load attributes from existing partition
if($object){
}
$this->status = $object['status'];
- $this->FAIdiskType = $type;
if($type == "disk" || $type =="lvm"){
{
$array = array();
foreach($this->parent->parent->disks as $disk){
- foreach($disk['partitions'] as $key => $part){
- $name = $disk['cn'];
- if(!isset($this->raidDevices[$name])){
- $array[$name] = $name;
+ if($disk['FAIdiskType'] != "raid"){
+ foreach($disk['partitions'] as $key => $part){
+ $name = $part['cn'];
+ if(!isset($this->raidDevices[$name])){
+ $array[$name] = $name." (".$disk['cn'].")";
+ }
}
}
}
$divlist = new divSelectBox("RaidList");
$disks = $this->parent->parent->disks;
- $objs = $disks;
+ $objs = array();
foreach($disks as $disk){
- foreach($disk['partitions'] as $id => $part){
- $objs[$disk['cn']] = $part;
+ if($disk['FAIdiskType'] != "raid"){
+ foreach($disk['partitions'] as $id => $part){
+ $objs[$part['cn']] = $part;
+ }
}
}
-
+
$list = array();
foreach($this->raidDevices as $device){
$list[$device['name']] = $device['name'];
}
}
}
+ if($this->FAIdiskType == "raid"){
+ #FIME raid checks missing
+ echo "Add raid checks here, disk combinations are not verified right now.";
+ }
// check mount point
if($this->FAIfsType != "swap"){
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index 8b6a690ecd78468d1276d3b68b1881695bfb2559..dd66cffbc929619bde05d55ddff416bb857d4467 100644 (file)
foreach($order as $cn=>$disk){
$disk_dn = "cn=".$disk['cn'].",".$this->dn;
$disk_attrs['cn'] = $disk['cn'];
- $disk_attrs['description'] = $disk['description'];
-
- if(isset($disk['FAIdiskType'])){
- $disk_attrs['FAIdiskType'] = $disk['FAIdiskType'];
- }
- if(isset($disk['FAIdiskOption'])){
- $disk_attrs['FAIdiskOption'] = $disk['FAIdiskOption'];
- }
- if(isset($disk['FAIlvmDevice'])){
- $disk_attrs['FAIlvmDevice'] = $disk['FAIlvmDevice'];
- }
-
- if(empty($disk_attrs['description']) && $disk['status'] == "edited"){
- $disk_attrs['description'] = array();
- }
-
$disk_attrs['objectClass'] = array("top","FAIclass","FAIpartitionDisk");
+
if($disk['status']=="new"){
$ldap->cat($disk_dn,array("objectClass"));
}
}
+ foreach(array("description","FAIdiskType","FAIdiskOption","FAIlvmDevice") as $attr){
+ if($disk['status'] == "new"){
+ if(isset($disk[$attr]) && !empty($disk[$attr])){
+ $disk_attrs[$attr] = $disk[$attr];
+ }
+ }else{
+ if(isset($disk[$attr]) && !empty($disk[$attr])){
+ $disk_attrs[$attr] = $disk[$attr];
+ }else{
+ $disk_attrs[$attr] = array();
+ }
+ }
+ }
+
+
/* Tag object */
$this->tag_attrs($disk_attrs, $disk_dn, $this->gosaUnitTag);