Commit 4cb31c9b authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Return the assign logfile when the mapper fails. More info for users.

parent 65dcf7a7
...@@ -1100,9 +1100,8 @@ sub GetTicketAuxAux($$$$$$$$) ...@@ -1100,9 +1100,8 @@ sub GetTicketAuxAux($$$$$$$$)
} }
system("$MAPPER -n -d -v -u -o $tmpfile $pid $eid"); system("$MAPPER -n -d -v -u -o $tmpfile $pid $eid");
if ($?) { if ($?) {
$response = my $logstuff = undef;
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Could not map to resources");
unlink($tmpfile); unlink($tmpfile);
if ($isupdate) { if ($isupdate) {
$slice_experiment->RemovePhysicalState(); $slice_experiment->RemovePhysicalState();
...@@ -1123,10 +1122,13 @@ sub GetTicketAuxAux($$$$$$$$) ...@@ -1123,10 +1122,13 @@ sub GetTicketAuxAux($$$$$$$$)
if (-e "assign.log") { if (-e "assign.log") {
print STDERR "----------------------------------------------\n"; print STDERR "----------------------------------------------\n";
print STDERR "------------- Assign Error Log ---------------\n"; print STDERR "------------- Assign Error Log ---------------\n";
my $log = `cat assign.log`; $logstuff = `cat assign.log`;
print STDERR $log . "\n"; print STDERR $logstuff . "\n";
print STDERR "----------------------------------------------\n"; print STDERR "----------------------------------------------\n";
} }
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, $logstuff,
"Could not map to resources");
goto bad; goto bad;
} }
my $solution = my $solution =
...@@ -1406,6 +1408,7 @@ sub SliverWorkAux($$$$$$$) ...@@ -1406,6 +1408,7 @@ sub SliverWorkAux($$$$$$$)
my ($credential, $object, $keys, $isupdate, $impotent, $v2, $level) = @_; my ($credential, $object, $keys, $isupdate, $impotent, $v2, $level) = @_;
my $didfwsetup = 0; my $didfwsetup = 0;
my $restorephys = 0; # Flag to restore physical state my $restorephys = 0; # Flag to restore physical state
my $response;
my $ticket; my $ticket;
my $rspec; my $rspec;
...@@ -1836,6 +1839,9 @@ sub SliverWorkAux($$$$$$$) ...@@ -1836,6 +1839,9 @@ sub SliverWorkAux($$$$$$$)
# Add -u for update mode, but not -f (fixnode). # Add -u for update mode, but not -f (fixnode).
system("$MAPPER -d -v -u $pid $eid"); system("$MAPPER -d -v -u $pid $eid");
if ($?) { if ($?) {
my $logstuff = undef;
$message = "Could not map to resources";
print STDERR "Mapper failed!\n"; print STDERR "Mapper failed!\n";
# Dump the vtop. # Dump the vtop.
if (-e "$pid-$eid.vtop") { if (-e "$pid-$eid.vtop") {
...@@ -1852,10 +1858,12 @@ sub SliverWorkAux($$$$$$$) ...@@ -1852,10 +1858,12 @@ sub SliverWorkAux($$$$$$$)
if (-e "assign.log") { if (-e "assign.log") {
print STDERR "----------------------------------------------\n"; print STDERR "----------------------------------------------\n";
print STDERR "------------- Assign Error Log ---------------\n"; print STDERR "------------- Assign Error Log ---------------\n";
my $log = `cat assign.log`; $logstuff = `cat assign.log`;
print STDERR $log . "\n"; print STDERR $logstuff . "\n";
print STDERR "----------------------------------------------\n"; print STDERR "----------------------------------------------\n";
} }
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, $logstuff, $message);
goto bad; goto bad;
} }
...@@ -2308,7 +2316,8 @@ sub SliverWorkAux($$$$$$$) ...@@ -2308,7 +2316,8 @@ sub SliverWorkAux($$$$$$$)
$slice->UnLock(); $slice->UnLock();
$ticket->UnLock() $ticket->UnLock()
if (defined($ticket)); if (defined($ticket));
return GeniResponse->Create(GENIRESPONSE_ERROR, undef, $message); return $response ||
GeniResponse->Create(GENIRESPONSE_ERROR, undef, $message);
} }
# #
......
Supports Markdown
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