Commit 6600d18c authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Change FindVlanByPort() to optionally lookup by lanid but without the

experiment.
parent 4b8a9915
......@@ -3045,17 +3045,20 @@ sub FindVlanByPort($$$)
{
my ($class, $experiment, $port) = @_;
my ($node_id, $card) = split(":", $port);
my $clause = "";
my $interface = Interface->Lookup($node_id, $card, 1);
return undef
if (!defined($interface));
my $iface = $interface->iface();
my $exptidx = $experiment->idx();
if (defined($experiment)) {
my $exptidx = $experiment->idx();
$clause = "exptidx='$exptidx' and";
}
my $query_result =
DBQueryWarn("select id from vlans ".
"where exptidx='$exptidx' and ".
" members like '%${node_id}:${iface}%'");
"where $clause members like '%${node_id}:${iface}%'");
return undef
if (!$query_result || !$query_result->numrows);
......
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