Commit 82a0cd82 authored by Leigh B Stoller's avatar Leigh B Stoller

Add the protogeni_error_url to the GeniResponse structure so that

we can get at it from users of CallMethod. Then in create_instance,
put that into the APT_Instance record so that we can easily see the
log file if there is a failure. That is displayed in the status page
when in red-dot mode.
parent 1443f26d
......@@ -710,11 +710,18 @@ while (1) {
$webtask->Exited(1);
}
}
if (defined($response) && defined($response->logurl())) {
$instance->SetPublicURL($response->logurl());
}
fatal("CreateSliver failed: ".
(defined($response) ? $response->output() : "") . "\n");
}
last;
}
# This will get overwritten later.
if (defined($response) && defined($response->logurl())) {
$instance->SetPublicURL($response->logurl());
}
#
# We are going to use the manifests table.
......
......@@ -146,9 +146,9 @@ sub XMLRPC_TRANSPORT_ERROR() { -32300; }
# For debugging, stash the method and arguments in case we want to
# print things out.
#
sub new($$;$$)
sub new($$;$$$)
{
my ($class, $code, $value, $output) = @_;
my ($class, $code, $value, $output, $logurl) = @_;
if (!defined($output)) {
$output = "";
......@@ -163,6 +163,9 @@ sub new($$;$$)
my $self = {"code" => $code,
"value" => $value,
"output" => $output};
$self->{"logurl"} = $logurl
if (defined($logurl));
bless($self, $class);
return $self;
}
......@@ -194,6 +197,10 @@ sub field($$) { return ($_[0]->{$_[1]}); }
sub code($) { return field($_[0], "code"); }
sub value($) { return field($_[0], "value"); }
sub output($) { return field($_[0], "output"); }
# This is very optional.
sub logurl($) {
return (exists($_[0]->{"logurl"}) ? $_[0]->{"logurl"} : undef);
}
# Check for response object. Very bad, but the XML encoder does not
# allow me to intercept the encoding operation on a blessed object.
......
#!/usr/bin/perl -w
#
# Copyright (c) 2008-2014 University of Utah and the Flux Group.
# Copyright (c) 2008-2015 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -303,7 +303,7 @@ sub CallMethod($$$@)
$xmlgoo =~ s/\<nil\/\>//g;
my $parser = RPC::XML::Parser->new();
my $goo = $parser->parse($xmlgoo);
my ($value,$output,$code);
my ($value,$output,$code,$logurl);
# Python servers seem to return faults in structs, not as <fault> elements.
# Sigh.
......@@ -345,6 +345,8 @@ sub CallMethod($$$@)
}
else {
$value = $goo->value()->{'value'}->value;
$logurl = $goo->value()->{'protogeni_error_url'}->value
if (exists($goo->value()->{'protogeni_error_url'}));
}
$output = $goo->value()->{'output'}->value
if (exists($goo->value()->{'output'}));
......@@ -353,7 +355,7 @@ sub CallMethod($$$@)
print STDERR "CallMethod: $method failed: $code";
print STDERR ", $output\n" if (defined($output) && $output ne "");
}
return GeniResponse->new($code, $value, $output);
return GeniResponse->new($code, $value, $output, $logurl);
}
......
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