Commit 464032a1 authored by Leigh Stoller's avatar Leigh Stoller

Small addition to allow easier prereserves for nonlocal projects (created

via the Geni API, which have hard to guess project names).

	boss> wap perl prereserve emulab.net:testbed 1

At the remote cluster, you prepend the domain of the SA (for the portal,
that is emulab.net) to the project name at the portal.  prereserve will
find the correct project, assuming at least one experiment has ever been
created on the remote cluster. If not, then this trivial little hack will
not work.
parent 4dc6ec7f
#!/usr/bin/perl -w
#
# Copyright (c) 2003-2014 University of Utah and the Flux Group.
# Copyright (c) 2003-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -64,6 +64,7 @@ my $endtime;
my $typelist;
my $pid;
my $count;
my $project;
# Protos
sub fatal($);
......@@ -227,9 +228,23 @@ if ($list) {
exit(0);
}
my $project = Project->Lookup($pid);
if (!defined($project)) {
fatal("No such project $pid\n");
if ($pid =~ /^(.*):(.*)$/) {
require GeniHRN;
my $urn = GeniHRN::Generate($pid, "authority", "sa");
$project = Project->LookupNonLocal($urn);
if (!defined($project)) {
fatal("No such nonlocal project $pid\n");
}
$pid = $project->pid();
}
else {
$project = Project->Lookup($pid);
if (!defined($project)) {
fatal("No such project $pid\n");
}
}
my $pid_idx = $project->pid_idx();
......
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