Commit 9a32224f authored by Leigh B Stoller's avatar Leigh B Stoller

Watch for quota violation exit from create_image and return new

response code GENIRESPONSE_NOSPACE.
parent 3e9fe5ff
......@@ -69,7 +69,7 @@ use Time::Local;
use Compress::Zlib;
use File::Temp qw(tempfile);
use MIME::Base64;
use Errno;
use Errno qw(:POSIX);
use List::Util qw(shuffle);
# Configure variables
......@@ -3412,7 +3412,14 @@ sub CreateImage($)
print STDERR $output;
if ($?) {
$slice->UnLock();
$response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, $output);
if ($? >> 8 == ENOSPC) {
$response = GeniResponse->Create(GENIRESPONSE_NOSPACE,
undef, $output);
}
else {
$response = GeniResponse->Create(GENIRESPONSE_ERROR,
undef, $output);
}
goto bad;
}
#
......
#!/usr/bin/perl -w
#
# Copyright (c) 2008-2016 University of Utah and the Flux Group.
# Copyright (c) 2008-2017 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -50,6 +50,7 @@ use vars qw(@ISA @EXPORT);
GENIRESPONSE_INSUFFICIENT_NODES GENIRESPONSE_SERVER_UNAVAILABLE
GENIRESPONSE_INSUFFICIENT_MEMORY GENIRESPONSE_NO_MAPPING
GENIRESPONSE_STITCHER_ERROR
GENIRESPONSE_NOSPACE
XMLRPC_PARSE_ERROR XMLRPC_SERVER_ERROR XMLRPC_APPLICATION_ERROR
XMLRPC_SYSTEM_ERROR XMLRPC_TRANSPORT_ERROR);
......@@ -77,6 +78,7 @@ sub GENIRESPONSE_BUSY() {14; }
sub GENIRESPONSE_EXPIRED() {15; }
sub GENIRESPONSE_INPROGRESS() {16; }
sub GENIRESPONSE_ALREADYEXISTS() {17; }
sub GENIRESPONSE_NOSPACE() {23; }
sub GENIRESPONSE_VLAN_UNAVAILABLE(){24; }
sub GENIRESPONSE_INSUFFICIENT_BANDWIDTH() {25; }
sub GENIRESPONSE_INSUFFICIENT_NODES() {26; }
......@@ -114,7 +116,7 @@ my @GENIRESPONSE_STRINGS =
"Error 20",
"Error 21",
"Error 22",
"Error 23",
"Not Enough Space",
"Vlan Unavailable",
"Insufficient Bandwidth",
"Insufficient Nodes",
......
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