[Fai-commit] r3625 -
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:10:26 UTC 2006
Author: michael-guest
Date: 2006-07-22 22:10:25 +0000 (Sat, 22 Jul 2006)
New Revision: 3625
Modified:
people/michael/features/setup_harddisks_2/implementation/shdd2-exec
Log:
added exec implementation
Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-exec
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-exec 2006-07-22 22:09:53 UTC (rev 3624)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-exec 2006-07-22 22:10:25 UTC (rev 3625)
@@ -1,8 +1,34 @@
#!/usr/bin/perl -w
use strict;
+use File::Temp;
package FAI;
+%FAI::ErrorHash = (
+"parted_1" => "Parted produced error. Couldn't remove Partition",
+);
+
+#my $error = &execute_command("parted rm 9 -s");
+
+
+sub execute_command
+{
+ my ($command) = @_;
+ (my $stderr_fh, my $stderr_filename) = File::Temp::tempfile();
+ (my $stdout_fh, my $stdout_filename) = File::Temp::tempfile();
+ `$command 1> $stdout_filename 2> $stderr_filename` ;
+ my $stderr = <$stderr_fh>;
+ my $stdout = <$stdout_fh>;
+ close($stderr_fh);
+ close($stdout_fh);
+
+ if( $command =~ /.*parted.*/ && $stderr_fh =~ /.*Error: Could not stat device rm - No such file or directory.*/)
+ {
+ return "parted_1";
+ }
+}
+
+
1;
More information about the Fai-commit
mailing list