aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly.no>2016-03-13 12:55:06 +0000
committerKristian Lyngstol <kly@kly.no>2016-03-13 12:55:06 +0000
commit9f992ae24299d81643188530bc6f79e76f141c03 (patch)
treed0e0796c547a7d34984b18ea6ed844d51ef11523
parentf8482d205ea5eaaa0aac33ab3cd450b41126ef39 (diff)
NMS: Pick up IP's properly
Nobody look because I just defaulted to ipv4.
-rw-r--r--include/nms/util.pm1
-rwxr-xr-xweb/nms.gathering.org/api/private/switch-add6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/nms/util.pm b/include/nms/util.pm
index 4623f92..79598d7 100644
--- a/include/nms/util.pm
+++ b/include/nms/util.pm
@@ -18,6 +18,7 @@ sub parse_switch {
'mgtmt4' => "$mgtmt4",
'mgtmt6' => "$mgtmt6",
'lolid' => "$lolid",
+ 'ip' => "$mgtmt4",
'distro' => "$distro"
);
%{$ret{'placement'}} = guess_placement($switch);
diff --git a/web/nms.gathering.org/api/private/switch-add b/web/nms.gathering.org/api/private/switch-add
index 5abe0f4..93416ff 100755
--- a/web/nms.gathering.org/api/private/switch-add
+++ b/web/nms.gathering.org/api/private/switch-add
@@ -45,6 +45,9 @@ foreach my $tmp2 (@tmp) {
} else {
%placement = %{$switch{'placement'}};
}
+ if (not defined($switch{'ip'}) and defined($switch{'mgtmt4'})) {
+ $switch{'ip'} = $switch{'mgtmt4'};
+ }
my ($x1,$x2,$y1,$y2);
$x1 = $placement{'x1'};
$y1 = $placement{'y1'};
@@ -70,6 +73,9 @@ foreach my $tmp2 (@tmp) {
$y2 = $switch{'placement'}{'yy'};
$switch{'placement'} = "(($x1,$y1),($x2,$y2))";
}
+ if (not defined($switch{'ip'}) and defined($switch{'mgtmt4'})) {
+ $switch{'ip'} = $switch{'mgtmt4'};
+ }
my @set;
map {
if (defined($template{$_})) {