diff options
author | Eugeni Dodonov <eugeni@mandriva.com> | 2010-06-14 15:09:09 -0300 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.com> | 2010-06-14 15:09:09 -0300 |
commit | c3f507245731a87fd04c95a571cef694b4725b21 (patch) | |
tree | 614f2451ed8704a900b1e700120dca390fa71596 /src/monitor.py | |
parent | ee0602c53e8638b4bad8c317962a43fc99159576 (diff) | |
download | net_monitor-c3f507245731a87fd04c95a571cef694b4725b21.tar net_monitor-c3f507245731a87fd04c95a571cef694b4725b21.tar.gz net_monitor-c3f507245731a87fd04c95a571cef694b4725b21.tar.bz2 net_monitor-c3f507245731a87fd04c95a571cef694b4725b21.tar.xz net_monitor-c3f507245731a87fd04c95a571cef694b4725b21.zip |
Properly detect when device dissapears (#57108)
Diffstat (limited to 'src/monitor.py')
-rw-r--r-- | src/monitor.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/monitor.py b/src/monitor.py index 45464f0..5a2bcfe 100644 --- a/src/monitor.py +++ b/src/monitor.py @@ -208,17 +208,19 @@ class Monitor: def get_traffic(self, iface, net=None): """Get traffic information""" + device_exists=False if not net: if not self.net: self.readnet() net = self.net if iface in net: + device_exists=True bytes_in = int(net[iface][0]) bytes_out = int(net[iface][8]) else: bytes_in = 0 bytes_out = 0 - return bytes_in, bytes_out + return device_exists, bytes_in, bytes_out def format_size(self, size, opt=""): """Pretty-Formats size""" |