We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 030dc72 + b2a08f3 commit 2ce7945Copy full SHA for 2ce7945
tools/view_stats.py
@@ -1,4 +1,4 @@
1
-#This utility prints PyHSS stats stored in Redis
+# This utility prints PyHSS stats stored in Redis
2
import yaml
3
import sys
4
with open(sys.path[0] + '/../config.yaml') as stream:
@@ -15,12 +15,13 @@
15
16
print("\n\nDiameter Peers:")
17
ActivePeerDict = r.get('ActivePeerDict')
18
-if len(ActivePeerDict) == 0:
+if ActivePeerDict is None or len(ActivePeerDict) == 0:
19
print("No connected peers.")
20
+ sys.exit()
21
ActivePeerDict = json.loads(ActivePeerDict)
22
23
for keys in ActivePeerDict:
24
print(keys)
25
for subkeys in ActivePeerDict[keys]:
26
print("\t" + str(subkeys) + ": \t" + str(ActivePeerDict[keys][subkeys]))
- print('\n')
27
+ print('\n')
0 commit comments