Skip to content

Commit ead288d

Browse files
committed
2 parents 51bfbdc + 5e84665 commit ead288d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ def Get_Charging_Rules(self, imsi, apn):
21682168
ChargingRule['apn_data'] = apn_data
21692169

21702170
#Get Charging Rules list
2171-
if apn_data['charging_rule_list'] == None:
2171+
if not apn_data['charging_rule_list'] or apn_data['charging_rule_list'].strip() == '':
21722172
self.logTool.log(service='Database', level='debug', message="No Charging Rule associated with this APN", redisClient=self.redisMessaging)
21732173
ChargingRule['charging_rules'] = None
21742174
return ChargingRule

tools/view_stats.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#This utility prints PyHSS stats stored in Redis
1+
# This utility prints PyHSS stats stored in Redis
22
import yaml
33
import sys
44
with open(sys.path[0] + '/../config.yaml') as stream:
@@ -15,12 +15,13 @@
1515

1616
print("\n\nDiameter Peers:")
1717
ActivePeerDict = r.get('ActivePeerDict')
18-
if len(ActivePeerDict) == 0:
18+
if ActivePeerDict is None or len(ActivePeerDict) == 0:
1919
print("No connected peers.")
20+
sys.exit()
2021
ActivePeerDict = json.loads(ActivePeerDict)
2122

2223
for keys in ActivePeerDict:
2324
print(keys)
2425
for subkeys in ActivePeerDict[keys]:
2526
print("\t" + str(subkeys) + ": \t" + str(ActivePeerDict[keys][subkeys]))
26-
print('\n')
27+
print('\n')

0 commit comments

Comments
 (0)