[Fai-commit] r3629 - people/michael/features/setup_harddisks_2/implementation

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Sat Jul 22 22:49:43 UTC 2006


Author: michael-guest
Date: 2006-07-22 22:49:43 +0000 (Sat, 22 Jul 2006)
New Revision: 3629

Modified:
   people/michael/features/setup_harddisks_2/implementation/shdd2-commands
   people/michael/features/setup_harddisks_2/implementation/shdd2-parser
   people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
Log:
replaced warn by die


Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-commands
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-commands	2006-07-22 22:36:03 UTC (rev 3628)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-commands	2006-07-22 22:49:43 UTC (rev 3629)
@@ -50,7 +50,7 @@
         {
           if ( !defined( $FAI::current_config{$disk}{"partitions"}{$part_id} ) )
           {
-            warn "$part_id can't be preserved, it does not exist.\n";
+            die "$part_id can't be preserved, it does not exist.\n";
           }
           else
           {
@@ -72,7 +72,7 @@
       {
         if ( scalar(@to_preserve) > 0 )
         {
-          warn "Can't change disklabel, partitions are to be preserved!\n";
+          die "Can't change disklabel, partitions are to be preserved!\n";
         }
         else
         {
@@ -106,7 +106,7 @@
         {
           if ( !defined( $FAI::current_config{$disk}{"partitions"}{$part_id} ) )
           {
-            warn "$part_id can't be preserved, it does not exist.\n";
+            die "$part_id can't be preserved, it does not exist.\n";
           }
           unless ( $FAI::configs{$config}{"disklabel"} eq "msdos"
             && $FAI::configs{$config}{"partitions"}{$part_id}{"size"}
@@ -123,12 +123,12 @@
         {
           if ( !defined( $FAI::current_config{$disk}{"partitions"}{$part_id} ) )
           {
-            warn "$part_id can't be resized, it does not exist.\n";
+            die "$part_id can't be resized, it does not exist.\n";
           }
           elsif ( $FAI::current_config{$disk}{"partitions"}{"filesystem"} ne
             $FAI::configs{$config}{"partitions"}{$part_id}{"filesystem"} )
           {
-            warn "Filesystem change has been requested for $part_id, can't
+            die "Filesystem change has been requested for $part_id, can't
             resize\n";
           }
           my $part_size =

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-parser
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-parser	2006-07-22 22:36:03 UTC (rev 3628)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-parser	2006-07-22 22:49:43 UTC (rev 3629)
@@ -313,14 +313,14 @@
           }
           else
           {
-            warn "partition number of to-be-preserved partition $1 changed to " .  $FAI::partition_pointer->{ "number" } . "\n";
+            die "partition number of to-be-preserved partition $1 changed to " .  $FAI::partition_pointer->{ "number" } . "\n";
           }
         }
         | /^[^\d,:\s\-][^,:\s]*(:(spare|missing))*(,[^,:\s]+(:(spare|missing))*)*\s+/
         {
           if( $FAI::device ne "RAID" || ! ( $FAI::device =~ /^VG_/ ) )
           {
-            warn "invalid within this context\n";
+            die "invalid within this context\n";
           }
           else
           {
@@ -345,7 +345,7 @@
         {
           if ( !&FAI::in_path("$item[1]") ) 
           {
-             warn "unknown/invalid filesystem type '$item[1]'";
+             die "unknown/invalid filesystem type $item[1]";
           }
           $FAI::partition_pointer->{ "filesystem" } = $item[ 1 ];
         }

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-22 22:36:03 UTC (rev 3628)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-22 22:49:43 UTC (rev 3629)
@@ -158,9 +158,9 @@
           $FAI::configs{$config}{"partitions"}{$part_id}{"size"}{"extended"} ==
           1 )
         {
-          ( $extended == -1 ) or warn "more than 1 extended partition\n";
+          ( $extended == -1 ) or die "more than 1 extended partition\n";
           ( $part_id <= 4 )
-            or warn "extended partition won't be a primary one\n";
+            or die "extended partition won't be a primary one\n";
           $extended = $part_id;
           $FAI::configs{$config}{"partitions"}{$part_id}{"size"}{"eff_size"} =
             0;
@@ -212,11 +212,15 @@
           }
           else
           {
-            warn "invalid range\n";
+            die "invalid range\n";
           }
         }
         else
         {
+          if ( !defined( $FAI::current_config{$disk}{"partitions"}{$part_id} ) )
+          {
+            die "$part_id can't be preserved, it does not exist.\n";
+          }
           $FAI::configs{$config}{"partitions"}{$part_id}{"size"}{"eff_size"} =
             $FAI::current_config{$disk}{"partitions"}{$part_id}{"count_byte"};
           $min_req_space +=
@@ -226,7 +230,7 @@
 
       if ( $min_req_space > $FAI::current_config{$disk}{"end_byte"} )
       {
-        warn "Disk is too small - at least $min_req_space is required\n";
+        die "Disk is too small - at least $min_req_space is required\n";
       }
 
       my $redist_factor =
@@ -252,14 +256,14 @@
           }
           else
           {
-            warn "invalid range\n";
+            die "invalid range\n";
           }
         }
       }
 
       if ( $FAI::configs{$config}{"disklabel"} ne "msdos" && $extended > -1 )
       {
-        warn "extended partitions are not supported by this disklabel\n";
+        die "extended partitions are not supported by this disklabel\n";
       }
 
       if ( $FAI::configs{$config}{"disklabel"} eq "msdos" && $extended > -1 )
@@ -278,7 +282,7 @@
     }
     else
     {
-      warn "Internal error (invalid config entry $config).\n";
+      die "Internal error (invalid config entry $config).\n";
     }
   }
 }




More information about the Fai-commit mailing list