Commit 8488ed3b authored by Leigh B Stoller's avatar Leigh B Stoller

Watch for a local experiment of the same name when the target cluster

is the local cluster. This closes issue #114.
parent 908818a3
...@@ -89,8 +89,10 @@ my $UPDATEGENIUSER= "$TB/sbin/protogeni/updategeniuser"; ...@@ -89,8 +89,10 @@ my $UPDATEGENIUSER= "$TB/sbin/protogeni/updategeniuser";
my $STITCHER = "$TB/gcf/src/stitcher.py"; my $STITCHER = "$TB/gcf/src/stitcher.py";
my $OPENSSL = "/usr/bin/openssl"; my $OPENSSL = "/usr/bin/openssl";
my $MANAGEINSTANCE= "$TB/bin/manage_instance"; my $MANAGEINSTANCE= "$TB/bin/manage_instance";
my $MANAGEDATASET = "$TB/bin/manage_dataset";
my $DEFAULT_URN = "urn:publicid:IDN+$OURDOMAIN+authority+cm"; my $DEFAULT_URN = "urn:publicid:IDN+$OURDOMAIN+authority+cm";
my $GUEST_URN = "urn:publicid:IDN+apt.emulab.net+authority+cm"; my $GUEST_URN = "urn:publicid:IDN+apt.emulab.net+authority+cm";
my $PROTOGENI_LOCALUSER= @PROTOGENI_LOCALUSER@;
my $default_aggregate_urn = $DEFAULT_URN; my $default_aggregate_urn = $DEFAULT_URN;
# un-taint path # un-taint path
...@@ -112,6 +114,7 @@ use APT_Instance; ...@@ -112,6 +114,7 @@ use APT_Instance;
use APT_Geni; use APT_Geni;
use APT_Dataset; use APT_Dataset;
use APT_Aggregate; use APT_Aggregate;
use Experiment;
use User; use User;
use Project; use Project;
use Group; use Group;
...@@ -638,9 +641,12 @@ my $SERVER_NAME = (exists($ENV{"SERVER_NAME"}) ? $ENV{"SERVER_NAME"} : ""); ...@@ -638,9 +641,12 @@ my $SERVER_NAME = (exists($ENV{"SERVER_NAME"}) ? $ENV{"SERVER_NAME"} : "");
# #
# Make sure slice is unique. Probably retry here at some point. # Make sure slice is unique. Probably retry here at some point.
# #
if (GeniSlice->Lookup($slice_hrn) || GeniSlice->Lookup($slice_urn)) { if (GeniSlice->Lookup($slice_hrn) || GeniSlice->Lookup($slice_urn) ||
($PROTOGENI_LOCALUSER &&
(grep {$_ eq $DEFAULT_URN} @aggregate_urns) &&
Experiment->Lookup($project->pid(), $userslice_id))) {
if (defined($userslice_id)) { if (defined($userslice_id)) {
UserError("Slice name already in use, please use another. If you ". UserError("Experiment name already in use, please use another. If you ".
"just terminated an experiment with this name, it takes a ". "just terminated an experiment with this name, it takes a ".
"minute or two for the name to become available again."); "minute or two for the name to become available again.");
} }
......
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