Commit a1965775 authored by Gary Wong's avatar Gary Wong

A slightly more robust fix to stop ptopgen from occasionally generating

invalid XML.  We previously used a workaround in GeniSES.pm to keep
the demo alive.
parent 27b6505a
......@@ -82,11 +82,6 @@ sub Map($)
$ad = uncompress( decode_base64( $ad->value ) );
}
# Temporary ugly hack: ptopgen occasionally spits out invalid
# bandwidth elements. We'll patch them up by hand until ptopgen
# is fixed...
$ad =~ s{<bandwidth></bandwidth>}{<bandwidth>100000</bandwidth>}g;
#
# Use assign in xml mode to spit back an xml file.
#
......
......@@ -1331,11 +1331,10 @@ sub get_iface {
sub get_ifacebw {
($node,$card,$port,$protocol) = @_;
if (defined($interfacetypes{"$node:$card:$port"})) {
return $interfacespeeds{$interfacetypes{"$node:$card:$port"}}{$protocol};
}
else {
return $default_switchport_speed;
my $bw = $interfacespeeds{$interfacetypes{"$node:$card:$port"}}{$protocol};
return $bw if defined( $bw );
}
return $default_switchport_speed;
}
sub get_ifaceswitch {
......
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