Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 97ed8ef

Browse files
committedSep 3, 2021
Fix for 100% loss of packets
1 parent ec4d928 commit 97ed8ef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎python2port.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ def pingStatistics(ip):
6060
stats.append(block[1])
6161
stats.append(block[2])
6262
stats.append(block[3].strip('\n'))
63-
stats.append(re.search(regex_per_loss, output).group(1))
63+
loss = re.search(regex_per_loss, output).group(1)
64+
stats.append(loss)
6465
print " > STATISTICS FOR [ ", ip, " ] ==> ", stats
65-
return stats
66+
if loss == '100%':
67+
return ['HOST_DOWN', 'HOST_DOWN', 'HOST_DOWN', 'HOST_DOWN', loss]
68+
else:
69+
return stats
6670

6771
except:
6872
print(' > STATISTCS_FAILURE')

0 commit comments

Comments
 (0)
Please sign in to comment.