[Fai-commit] r5446 - in trunk: debian lib/setup-storage

Michael Tautschnig mt at alioth.debian.org
Sun Jul 19 15:34:05 UTC 2009


Author: mt
Date: 2009-07-19 15:34:03 +0000 (Sun, 19 Jul 2009)
New Revision: 5446

Modified:
   trunk/debian/changelog
   trunk/lib/setup-storage/Volumes.pm
Log:
merged patch for 532321


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-07-19 15:31:07 UTC (rev 5445)
+++ trunk/debian/changelog	2009-07-19 15:34:03 UTC (rev 5446)
@@ -48,6 +48,9 @@
     count as extra RAID volumes being defined.
   * setup-storage/Parser.pm, setup-storage/Sizes.pm: Added support for raid10
     (thanks William Francis for suggesting this).
+  * setup-storage/Volumes.pm: Fixed perl syntax error, properly handle
+    existing empty volume groups (thanks Brian Kroth and Cajus Pollmeier for
+    debugging this).  (closes: #532321)
   
  -- Thomas Lange <lange at debian.org>  Sun, 19 Jul 2009 12:08:02 +0200
 

Modified: trunk/lib/setup-storage/Volumes.pm
===================================================================
--- trunk/lib/setup-storage/Volumes.pm	2009-07-19 15:31:07 UTC (rev 5445)
+++ trunk/lib/setup-storage/Volumes.pm	2009-07-19 15:34:03 UTC (rev 5446)
@@ -305,23 +305,26 @@
   foreach my $vg (get_volume_group_list()) {
     # initialise the hash entry
     $FAI::current_lvm_config{$vg}{physical_volumes} = ();
-    &FAI::push_command( "true", "", "vg_created_$vg" );
+    &FAI::push_command("true", "", "vg_created_$vg");
 
     # store the vg size in MB
     my %vg_info = get_volume_group_information($vg);
-    $FAI::current_lvm_config{$vg}{size} =
-      &FAI::convert_unit( $vg_info{alloc_pe_size} .
-        $vg_info{alloc_pe_size_unit} );
+    if (%vg_info) {
+      $FAI::current_lvm_config{$vg}{size} = $vg_info{alloc_pe_size} .
+        $vg_info{alloc_pe_size_unit};
+    } else {
+      $FAI::current_lvm_config{$vg}{size} = "0M";
+    }
 
-      # store the logical volumes and their sizes
+    # store the logical volumes and their sizes
     my %lv_info = get_logical_volume_information($vg);
     foreach my $lv_name (sort keys %lv_info) {
       my $short_name = $lv_name;
-      $short_name =~ "s{/dev/\Q$vg\E/}{}";
+      $short_name =~ s{/dev/\Q$vg\E/}{};
       $FAI::current_lvm_config{$vg}{volumes}{$short_name}{size} =
         &FAI::convert_unit($lv_info{$lv_name}->{lv_size} .
           $lv_info{$lv_name}->{lv_size_unit});
-      &FAI::push_command( "true", "", "exist_/dev/$vg/$short_name" );
+      &FAI::push_command("true", "", "exist_/dev/$vg/$short_name");
     }
 
     # store the physical volumes




More information about the Fai-commit mailing list