[freeside-commits] freeside/FS/FS/NetworkMonitoringSystem Torrus_Internal.pm, 1.8, 1.9

Ivan,,, ivan at wavetail.420.am
Fri Feb 25 18:13:22 PST 2011


Update of /home/cvs/cvsroot/freeside/FS/FS/NetworkMonitoringSystem
In directory wavetail.420.am:/tmp/cvs-serv4441

Modified Files:
	Torrus_Internal.pm 
Log Message:
fix error on port view when you haven't selected a torrus serviceid yet

Index: Torrus_Internal.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -d -r1.8 -r1.9
--- Torrus_Internal.pm	26 Feb 2011 01:44:10 -0000	1.8
+++ Torrus_Internal.pm	26 Feb 2011 02:13:20 -0000	1.9
@@ -72,7 +72,7 @@
     # hardcoded for 'main' tree for now 
     my $self = shift;
     my $serviceid = shift;
-    my $hash = $self->get_router_serviceids(undef,$serviceid);
+    my $hash = $self->get_router_serviceids(undef,$serviceid) or return '';
     my @keys = keys %$hash; # yeah this is weird...
     my $host = $keys[0];
     my $iface = $hash->{$keys[0]};
@@ -205,7 +205,6 @@
   print $new $ddx;
   close $new;
 
-  # `date ...` created file names with weird chars in them
   my $tmpname = $ddxfile . Date::Format::time2str('%Y%m%d%H%M%S',time);
   rename("$ddxfile", $tmpname) or die $!;
   rename("$ddxfile.new", $ddxfile) or die $!;
@@ -216,7 +215,8 @@
 sub _torrus_reload {
   my($self) = @_;
 
-  #i should use IPC::Run and have better error checking
+  #i should use IPC::Run and have better error checking (commands are silent
+  # for success, or output errors)
 
   system('torrus', 'devdiscover', "--in=$ddxfile");
 



More information about the freeside-commits mailing list