Code

Updated FAI partition handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Jul 2009 14:12:38 +0000 (14:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Jul 2009 14:12:38 +0000 (14:12 +0000)
-Added FAIlvmDevice handling to lvm devices

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13965 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc

index 6e002f5ac4ac2bfd8c99057a2c5197382365c450..a1f0e420e8e9cf34b6938194007111b681e54a00 100644 (file)
@@ -31,7 +31,7 @@ class faiDiskEntry extends plugin
   function faiDiskEntry (&$config, $dn= NULL,$parent,$disk,$type)
   {
     plugin::plugin ($config, $dn);
-
+  
     // Set default attributes 
     $this->parent = $parent;
     $this->FAIdiskType = $type;
@@ -41,6 +41,11 @@ class faiDiskEntry extends plugin
     //  an existing disk, load disk info now. 
     if($disk){
 
+      // Get devices used in volume base disks.
+      if($disk['FAIlvmDevice']){
+        $this->lvmDevices = $disk['FAIlvmDevice'];
+      }
+
       // Get disk status
       $this->status = $disk['status'];
 
@@ -270,11 +275,11 @@ class faiDiskEntry extends plugin
 
     $list = array();
     foreach($this->lvmDevices as $device){
-      $list[$device['name']] = $device['name'];
+      $list[$device] = $device;
 
-      if(isset($objs[$device['name']]['FAIpartitionSize'])){
-        $list[$device['name']].= _("Size").":&nbsp;";
-        $list[$device['name']].= $objs[$device['name']]['FAIpartitionSize'];
+      if(isset($objs[$device]['FAIpartitionSize'])){
+        $list[$device].= _("Size").":&nbsp;";
+        $list[$device].= $objs[$device]['FAIpartitionSize'];
       }
     }
     return($list);
@@ -409,6 +414,11 @@ class faiDiskEntry extends plugin
     $tmp['status']      = $this->status;
     $tmp['FAIdiskType'] = $this->FAIdiskType;
 
+    $tmp['FAIlvmDevice'] = array();
+    foreach($this->lvmDevices as $dev){
+      $tmp['FAIlvmDevice'][] = $dev;
+    } 
+
     /* Assemble flags */
     $tmp['FAIdiskOption'] = array("fstabkey:".$this->fstabkey, "disklabel:".$this->disklabel);
 
index ad1cc3a570a61d54356bebe72ba8f9799ad3d702..9534a765e1afef84ca18981a5b89c3b45e717139 100644 (file)
@@ -8,7 +8,7 @@ class faiPartitionTable extends plugin
   var $objectclasses    = array("top","FAIclass","FAIpartitionTable");
 
   var $subAttributes      = array("cn","description");
-  var $subPartAttributes  = array("cn","FAIpartitionNr","FAIpartitionSize","FAImountPoint","FAIfsType","FAIpartitionType","FAImountOptions","FAIfsOptions","FAIpartitionFlags","description","FAIfsCreateOptions","FAIfsTuneOptions","FAIfsOptions","FAIpartitionFlags");
+  var $subPartAttributes  = array("cn","FAIpartitionNr","FAIpartitionSize","FAImountPoint","FAIfsType","FAIpartitionType","FAImountOptions","FAIfsOptions","FAIpartitionFlags","description","FAIfsCreateOptions","FAIfsTuneOptions","FAIfsOptions","FAIpartitionFlags","FAIlvmDevice");
 
   var $sub64coded = array();
   var $subBinary = array();
@@ -548,6 +548,9 @@ class faiPartitionTable extends plugin
       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();