Commit b314d660 authored by Leigh Stoller's avatar Leigh Stoller

When protogeni is enabled, do not allow user to be deleted if they

have slices.
parent de065477
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -34,7 +34,8 @@ my $TBOPS = "@TBOPSEMAIL@";
my $TBLOGS = "@TBLOGSEMAIL@";
my $CONTROL = "@USERNODE@";
my $BOSSNODE= "@BOSSNODE@";
my $OURDOMAIN = "@OURDOMAIN@";
my $PGENISUPPORT = @PROTOGENI_SUPPORT@;
my $MODGROUPS = "$TB/sbin/modgroups";
my $DELACCT = "$TB/sbin/tbacct del";
......@@ -145,6 +146,25 @@ if (! $this_user->IsAdmin()) {
}
}
#
# Check to see if user has created slices (SA).
#
if ($PGENISUPPORT) {
require GeniDB;
require GeniUser;
require GeniSlice;
require GeniHRN;
# Connect to the proper DB.
GeniDB::DBConnect(GeniDB::GENISA_DBNAME());
my $urn = GeniHRN::Generate("@OURDOMAIN@", "user", $target_uid);
my $geniuser = GeniUser->Lookup($urn, 1);
if (defined($geniuser) && GeniSlice->LookupByCreator($geniuser)) {
fatal("$target_user is still heading up ProtoGENI Slices");
}
}
#
# Sanity check. Must not be the head of any experiments (in the project).
#
......
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