Commit 11b78302 authored by Leigh Stoller's avatar Leigh Stoller

Program agent names need to be unique within the experiment, the event

scheduler does not like duplicates.
parent 07de64d0
...@@ -1039,6 +1039,7 @@ sub GetTicketAuxAux($) ...@@ -1039,6 +1039,7 @@ sub GetTicketAuxAux($)
my %lannodes = (); my %lannodes = ();
my %allnodes = (); my %allnodes = ();
my %bsnames = (); my %bsnames = ();
my %prognames= ();
# Extra nodes (like XEN vhosts). # Extra nodes (like XEN vhosts).
my %internal_nodemap = (); my %internal_nodemap = ();
# For stitching, keep track of external nodes and links. # For stitching, keep track of external nodes and links.
...@@ -1823,10 +1824,24 @@ sub GetTicketAuxAux($) ...@@ -1823,10 +1824,24 @@ sub GetTicketAuxAux($)
$nodeblob->{"rootkey_private"} = -1; # means did not specify. $nodeblob->{"rootkey_private"} = -1; # means did not specify.
} }
} }
# Program agents. #
# Program agents. We have to watch for duplicate names, the event
# system assumes each one is uniquely named.
#
if (my @progagents = GeniXML::GetProgramAgents($ref)) { if (my @progagents = GeniXML::GetProgramAgents($ref)) {
foreach my $agent (@progagents) { foreach my $agent (@progagents) {
my $vname = $agent->{"name"};
if (!defined($vname)) {
return GeniResponse->MalformedArgsResponse(
"No name for program agent");
}
if (exists($prognames{$vname})) {
return GeniResponse->MalformedArgsResponse(
"Emulab program agent names must be unique: $vname");
}
$prognames{$vname} = $vname;
$response = AddProgramAgent($virtexperiment, $response = AddProgramAgent($virtexperiment,
$node_nickname, $agent); $node_nickname, $agent);
goto bad goto bad
......
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