Commit f20a9bf0 authored by Leigh B Stoller's avatar Leigh B Stoller

Fix syntax error that caused the monitor to die while I was out of town.

parent 5e304942
...@@ -187,7 +187,9 @@ sub CheckAggregates() ...@@ -187,7 +187,9 @@ sub CheckAggregates()
my $markError = sub($$) { my $markError = sub($$) {
my ($aggregate, $error) = @_; my ($aggregate, $error) = @_;
print STDERR $error . "\n"; my $nickname = $aggregate->nickname();
print STDERR "$nickname: $error\n";
# #
# Decide if aggregate should be marked as down. # Decide if aggregate should be marked as down.
...@@ -253,7 +255,8 @@ sub CheckAggregates() ...@@ -253,7 +255,8 @@ sub CheckAggregates()
Genixmlrpc::CallMethod($cmurl, $context, "GetVersion"); Genixmlrpc::CallMethod($cmurl, $context, "GetVersion");
if ($response->code() != GENIRESPONSE_SUCCESS) { if ($response->code() != GENIRESPONSE_SUCCESS) {
&$markError("$nickname GetVersion error: " . $response->output()); &$markError($aggregate,
"GetVersion error: " . $response->output());
next; next;
} }
...@@ -268,7 +271,8 @@ sub CheckAggregates() ...@@ -268,7 +271,8 @@ sub CheckAggregates()
Genixmlrpc::CallMethod($cmurl, $context, "ListResources", @params); Genixmlrpc::CallMethod($cmurl, $context, "ListResources", @params);
if ($response->code() != GENIRESPONSE_SUCCESS) { if ($response->code() != GENIRESPONSE_SUCCESS) {
&$markError("$nickname ListResources error: ". $response->output()); &$markError($aggregate,
"ListResources error: ". $response->output());
next; next;
} }
if ($debug > 1) { if ($debug > 1) {
...@@ -280,12 +284,12 @@ sub CheckAggregates() ...@@ -280,12 +284,12 @@ sub CheckAggregates()
# #
my $decoded = eval { decode_base64($response->value()); }; my $decoded = eval { decode_base64($response->value()); };
if ($@) { if ($@) {
&$markError("$nickname: Could not base64 decode response"); &$markError($aggregate, "Could not base64 decode response");
next; next;
} }
my $xml = eval { uncompress($decoded); }; my $xml = eval { uncompress($decoded); };
if ($@) { if ($@) {
&$markError("$nickname: Could not uncompress response"); &$markError($aggregate, "Could not uncompress response");
next; next;
} }
if ($debug > 1) { if ($debug > 1) {
...@@ -293,7 +297,7 @@ sub CheckAggregates() ...@@ -293,7 +297,7 @@ sub CheckAggregates()
} }
my $manifest = GeniXML::Parse($xml); my $manifest = GeniXML::Parse($xml);
if (!defined($manifest)) { if (!defined($manifest)) {
&$markError("$nickname: Could not parse manifest"); &$markError($aggregate, "Could not parse manifest");
next; next;
} }
# #
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment