[Fai-commit] r6480 - trunk/lib/setup-storage

Michael Tautschnig mt at alioth.debian.org
Mon Apr 18 13:09:30 UTC 2011


Author: mt
Date: 2011-04-18 13:09:16 +0000 (Mon, 18 Apr 2011)
New Revision: 6480

Modified:
   trunk/lib/setup-storage/Parser.pm
Log:
setup-storage/Parser.pm: Fixed mis-merge of align-at parsing and made it more robust.


Modified: trunk/lib/setup-storage/Parser.pm
===================================================================
--- trunk/lib/setup-storage/Parser.pm	2011-04-18 13:04:08 UTC (rev 6479)
+++ trunk/lib/setup-storage/Parser.pm	2011-04-18 13:09:16 UTC (rev 6480)
@@ -573,10 +573,6 @@
             }
           }
         }
-        | /^align-at:(\d+[kKMGTPiB]*)/
-        {
-          $FAI::configs{$FAI::device}{align_at} = &FAI::convert_unit($1) * 1024.0 * 1024.0;
-        }
 
 
     option: /^preserve_always:((\d+(,\d+)*)|all)/
@@ -694,6 +690,11 @@
             $FAI::configs{$FAI::device}{partitions}{$_}{size}{always_format} = 1 foreach (split(",", $1));
           }
         }
+        | /^align-at:(\d+[kKMGTPiB]*)/
+        {
+          my $u = defined($2) ? $2 : "MiB";
+          $FAI::configs{$FAI::device}{align_at} = &FAI::convert_unit("$1$u") * 1024.0 * 1024.0;
+        }
 
     volume: /^vg\s+/ name devices vgcreateopt(s?)
         | /^raid([0156]|10)\s+/




More information about the Fai-commit mailing list