[DRBD-cvs] testing by lars; abstract out drbd specifics; part I

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Mon, 7 Jun 2004 12:16:44 +0200 (CEST)


DRBD CVS committal

Author  : lars
Project : drbd
Module  : testing

Dir     : drbd/testing/CTH/LGE_CTH


Modified Files:
      Tag: rel-0_7-branch
	FileSystem.pm Node.pm 


Log Message:
abstract out drbd specifics; part I
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/LGE_CTH/Attic/FileSystem.pm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -3 -r1.1.2.1 -r1.1.2.2
--- FileSystem.pm	27 May 2004 12:44:18 -0000	1.1.2.1
+++ FileSystem.pm	7 Jun 2004 10:16:39 -0000	1.1.2.2
@@ -1,5 +1,5 @@
 package LGE_CTH::FileSystem;
-# $Id: FileSystem.pm,v 1.1.2.1 2004/05/27 12:44:18 lars Exp $
+# $Id: FileSystem.pm,v 1.1.2.2 2004/06/07 10:16:39 lars Exp $
 use strict;
 use warnings;
 use Carp;
@@ -18,7 +18,7 @@
 	config_template => {
 		type => undef,
 		mount_point => undef,
-		drbd => undef,
+		bdev => undef,
 		do_once => '',
 		do_once_per_node => '',
 		do_on_first_start => '# mkfs_$type, set in CheckConfig',
@@ -33,14 +33,14 @@
 	my $type = $me->{_config}->{type};
 	$me->SUPER::CheckConfig;
 	$me->{_config}->{do_on_first_start} = "mkfs_$type";
-	# FIXME add more paranoia, check that drbd is right class, ...
+	# FIXME add more paranoia, check that bdev is right class, ...
 
-	$me->depends_on($me->{_config}->{drbd});
+	$me->depends_on($me->{_config}->{bdev});
 }
 
 sub env {
 	my $me = shift;
-	my $minor = $me->{_config}->{drbd}->{_config}->{minor};
+	my $minor = $me->{_config}->{bdev}->{_config}->{minor};
 	return "TYPE=$me->{_config}->{type} DEV=/dev/nb$minor MNT=$me->{_config}->{mount_point}";
 }
 
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/LGE_CTH/Attic/Node.pm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -3 -r1.1.2.1 -r1.1.2.2
--- Node.pm	27 May 2004 12:44:18 -0000	1.1.2.1
+++ Node.pm	7 Jun 2004 10:16:39 -0000	1.1.2.2
@@ -1,5 +1,5 @@
 package LGE_CTH::Node;
-# $Id: Node.pm,v 1.1.2.1 2004/05/27 12:44:18 lars Exp $
+# $Id: Node.pm,v 1.1.2.2 2004/06/07 10:16:39 lars Exp $
 
 use strict;
 use warnings;
@@ -116,7 +116,8 @@
 	my ($hostname,$ip,$timeout) =
 		@{$me->{_config}}{qw(hostname admin_ip boot_timeout)};
 	my $initial = $me->{_status}->{status} eq '__UNDEF__' ? "true" : "false";
-	my $cmd = "ip=$ip\nhostname=$hostname\ntimeout=$timeout\ninitial=$initial\n"
+	my $have_drbd = scalar(grep { /^DRBD/ } keys %{$me->{_users}}) ? "true" : "false";
+	my $cmd = "ip=$ip\nhostname=$hostname\ntimeout=$timeout\ninitial=$initial\nhave_drbd=$have_drbd\n"
 		. $me->{_config}->{boot_script};
 
 	$me->{_busy} = "wait_for_boot";