diff options
-rw-r--r-- | include/nms/util.pm | 1 | ||||
-rwxr-xr-x | web/nms.gathering.org/api/private/switch-add | 6 |
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{$_})) { |