CVS User Account cvsuser
Mon Mar 27 13:50:13 PST 2006
Log Message:
-----------
test scripts to analyze cluster status had trouble, initially, with
user and host values:

- User option was ignored; ident name used instead

  Change to draw uname, by default, and override if a value is passed in.
  And then use that value to generate the DSN

- If host option was not specified, it would specify a blank host, 
  which would break.

  Set $host with default of "localhost" so it won't be blank if not set.

Modified Files:
--------------
    slony1-engine/tools:
        test_slony_state-dbi.pl (r1.1 -> r1.2)
        test_slony_state.pl (r1.3 -> r1.4)

-------------- next part --------------
Index: test_slony_state-dbi.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/test_slony_state-dbi.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -Ltools/test_slony_state-dbi.pl -Ltools/test_slony_state-dbi.pl -u -w -r1.1 -r1.2
--- tools/test_slony_state-dbi.pl
+++ tools/test_slony_state-dbi.pl
@@ -25,14 +25,16 @@
 $database = $opt_database if (defined($opt_database));
 $port = 5432;
 $port = $opt_port if (defined($opt_port));
+$user = `uname`;  chomp $user;
 $user = $opt_user if (defined($opt_user));
 $password = $opt_password if (defined($opt_password));
+$host = "localhost";
 $host = $opt_host if (defined($opt_host));
 $cluster = $opt_cluster if (defined($opt_cluster));
 $recipient = $opt_recipient if (defined($opt_recipient));
 $mailprog = $opt_mailprog if (defined($opt_mailprog));
 
-my $initialDSN = "dbi:Pg:dbname=$database;host=$host;port=$port";
+my $initialDSN = "dbi:Pg:dbname=$database;host=$host;port=$port;user=$user";
 $initialDSN = $initialDSN . ";password=$password" if defined($opt_password);
 
 print "DSN: $initialDSN\n===========================\n";
Index: test_slony_state.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/test_slony_state.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -Ltools/test_slony_state.pl -Ltools/test_slony_state.pl -u -w -r1.3 -r1.4
--- tools/test_slony_state.pl
+++ tools/test_slony_state.pl
@@ -25,15 +25,17 @@
 $database = $opt_database if (defined($opt_database));
 $port = 5432;
 $port = $opt_port if (defined($opt_port));
+$user = `uname`;  chomp $user;
 $user = $opt_user if (defined($opt_user));
 $password = $opt_password if (defined($opt_password));
+$host = "localhost";
 $host = $opt_host if (defined($opt_host));
 $cluster = $opt_cluster if (defined($opt_cluster));
 $recipient = $opt_recipient if (defined($opt_recipient));
 $mailprog = $opt_mailprog if (defined($opt_mailprog));
 
 #DBI: my $initialDSN = "dbi:Pg:dbname=$database;host=$host;port=$port";
-my $initialDSN = "dbname=$database host=$host port=$port";
+my $initialDSN = "dbname=$database host=$host port=$port user=$user";
 $initialDSN = $initialDSN . " password=$password" if defined($opt_password);
 
 print "DSN: $initialDSN\n===========================\n";



More information about the Slony1-commit mailing list