From 743221ce137ad184ef4d3aa7dfd6cac630a62583 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 7 Aug 2009 14:48:45 +0000 Subject: [PATCH] Updated FAIpartition handling. -We are now able to remove partitions again. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14007 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiDiskEntry.inc | 20 +++++++++++-------- .../fai/admin/fai/class_faiPartitionTable.inc | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc index 77a6adc0a..9d3814420 100644 --- a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc @@ -56,7 +56,9 @@ class faiDiskEntry extends plugin $this->old_cn = $disk['cn']; // Load partition info - foreach($disk['partitions'] as $name => $values){ + foreach($disk['partitions'] as $values){ + + $name = $values['FAIpartitionNr']; // Do not load removed partitions if($values['status'] == "delete"){ @@ -629,6 +631,7 @@ class faiDiskEntry extends plugin * And prepare names and numbers. */ foreach($this->partitions as $key=>$val) { + if($val['status'] == "delete") continue; $this->partitions[$key]['FAIpartitionNr']=$key; if($this->FAIdiskType == "disk"){ $this->partitions[$key]['cn'] = $this->DISKcn.$key; @@ -637,13 +640,6 @@ class faiDiskEntry extends plugin } } - /* Attach deleted. - */ - foreach($this->deletePartitions as $key=>$val) { - $this->partitions[$key."-delete"]=$val; - $this->partitions[$key."-delete"]['status']="delete"; - } - $tmp['description'] = $this->DISKdescription; $tmp['partitions'] = $this->partitions; $tmp['status'] = $this->status; @@ -711,6 +707,14 @@ class faiDiskEntry extends plugin $tmp['FAIdiskOption'][] = "preserve_reinstall:".trim($preserve_reinstall,","); } + /* Attach deleted. + */ + foreach($this->deletePartitions as $val) { + $key = $val['FAIpartitionNr']; + $this->partitions[$key."-delete"]=$val; + $this->partitions[$key."-delete"]['status']="delete"; + } + $tmp['status'] = $this->status; return($tmp); } diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index 93f486090..8bcebec84 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -679,7 +679,7 @@ class faiPartitionTable extends plugin /* Important, mark all edited devices for removal. * If the partition number changes we do not have the object twice. */ - if($part['status'] == "edited"){ + if($part['status'] != "new"){ $part['status'] = "delete"; $newSetup[$partid] = $part; } -- 2.30.2