Changeset 882 for trunk/cgi-bin


Ignore:
Timestamp:
06/14/16 16:46:48 (8 years ago)
Author:
Kris Deugau
Message:

/dev

Add a safety fence to prevent deleting a container that still has

suballocations.

Tweak the error message handling a little

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r877 r882  
    30723072# explicitly deleting any suballocations of the block to be deleted.
    30733073
     3074      # See if we have child allocations.  Fail for now.
     3075      my ($childcount) = $dbh->selectrow_array("SELECT count(*) from allocations where parent_id = ?", undef, $id);
     3076      if ($childcount) {
     3077        $msg = '';
     3078        die "$binfo->{block} still has suballocations\n";
     3079      }
     3080
    30743081      # get parent info of the block we're deleting
    30753082      my $pinfo = getBlockData($dbh, $binfo->{parent_id});
     
    32383245    }; # end eval
    32393246    if ($@) {
    3240       $msg .= ": $@";
     3247      if ($msg) { $msg .= ": $@"; } else { $msg = $@; }
    32413248      eval { $dbh->rollback; };
    32423249      return ('FAIL', $msg);
Note: See TracChangeset for help on using the changeset viewer.