Hi,

I noticed there is buildfarm failure in crake, it fails with the
following error:
Mar 02 21:22:56 ./src/test/recovery/t/001_stream_rep.pl: Variable
declared in conditional statement at line 88, column 2.  Declare
variables outside of the condition.
([Variables::ProhibitConditionalDeclarations] Severity: 5)

I felt the variable declaration and the assignment need to be split as
it involves conditional statements. I have attached a patch which will
help in fixing the problem.
Thoughts?

Regards,
Vignesh
diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl
index 07a9912..cf5211d 100644
--- a/src/test/recovery/t/001_stream_rep.pl
+++ b/src/test/recovery/t/001_stream_rep.pl
@@ -84,8 +84,9 @@ sub test_target_session_attrs
 	my $node2_host = $node2->host;
 	my $node2_port = $node2->port;
 	my $node2_name = $node2->name;
+	my $target_name;
 
-	my $target_name = $target_node->name if (defined $target_node);
+	$target_name = $target_node->name if (defined $target_node);
 
 	# Build connection string for connection attempt.
 	my $connstr = "host=$node1_host,$node2_host ";

Reply via email to