Commit 1f804b89 authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Add a unique URN to every error log response to correlate with log email.

parent 8d9a4554
......@@ -43,7 +43,9 @@ $EMULAB_PEMFILE = "$ETCDIR/genicm.pem";
# Testbed libraries.
use lib '@prefix@/lib';
use emutil;
use GeniAM;
use GeniHRN;
use GeniResponse;
if (!defined($GENI_VERSION)) {
......@@ -129,7 +131,7 @@ sub ConvertResponseV2($)
# the geni_code to ERROR
$geni_code = GeniResponse::GENIRESPONSE_ERROR();
}
my $errorLog = "";
my $blob = {
"value" => GeniResponse::value($geni_response),
"output" => GeniResponse::output($geni_response),
......@@ -139,6 +141,12 @@ sub ConvertResponseV2($)
"am_type" => "protogeni"
}
};
if (GeniResponse::IsError($geni_response)) {
my $log = TBGetUniqueIndex('next_geni_log', 1);
my $errorLog = GeniHRN::Generate("@OURDOMAIN@", "log", $log);
print STDERR "ERROR_LOG=" . $errorLog . "\n";
$blob->{'code'}->{'protogeni_error_log'} = $errorLog;
}
if (defined($version)) {
$blob->{"geni_api"} = $version;
......
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