Commit 83477fc9 authored by Leigh B Stoller's avatar Leigh B Stoller

When getting a ticket, make sure to "fix" the selected ifaces in the

DB so that when the ticket is redeemed (and we run the mapper again to
actually insert the DB state), we get the same ifaces. We really
cannot depend on assign to pick the same ifaces each time. Sure hope
this works!
parent 930f0646
......@@ -992,7 +992,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"vport" => $vport};
# This is used after the mapper runs since it uses vname:vport.
$vportmap{"$node_nickname:$vport"} = $linkref;
$vportmap{"$node_nickname:$vport"} = {"rspec" => $linkref};
}
}
......@@ -1151,8 +1151,9 @@ sub GetTicketAuxAux($$$$$$$$$)
if (defined($user_bandwidth)) {
$bandwidth = $user_bandwidth;
}
$virtexperiment->NewTableRow("virt_lans",
my $virtlan =
$virtexperiment->NewTableRow("virt_lans",
{"vname" => $lanname,
"vnode" => $node_nickname,
"vport" => $iface_vport,
......@@ -1167,6 +1168,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"rbandwidth" => $bandwidth, # kbps
"rlossrate" => 0.0,
"fixed_iface" => $iface_name});
$vportmap{$member}->{"virtlan"} = $virtlan;
$ifacenum++;
}
$linknum++;
......@@ -1352,12 +1354,16 @@ sub GetTicketAuxAux($$$$$$$$$)
"Virtual node ID or virtual interface ID missing on interface");
goto bad;
}
my $linkref = $vportmap{"$virtual_node_id:$virtual_port_id"};
my $vportp = $vportmap{"$virtual_node_id:$virtual_port_id"};
my $linkref = $vportp->{'rspec'};
my $virtlan = $vportp->{'virtlan'};
$virtlan->fixed_iface($component_id)
if (defined($component_id));
$component_id = "lo0"
if (!defined($component_id));
if (! GeniXML::SetText("component_id", $linkref, $component_id)) {
$response = GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Bad XML: Failed to add component_id");
"Bad XML: Failed to add component_id");
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