Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkneipp committed Oct 23, 2024
2 parents 51bfbdc + 5e84665 commit ead288d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ def Get_Charging_Rules(self, imsi, apn):
ChargingRule['apn_data'] = apn_data

#Get Charging Rules list
if apn_data['charging_rule_list'] == None:
if not apn_data['charging_rule_list'] or apn_data['charging_rule_list'].strip() == '':
self.logTool.log(service='Database', level='debug', message="No Charging Rule associated with this APN", redisClient=self.redisMessaging)
ChargingRule['charging_rules'] = None
return ChargingRule
Expand Down
7 changes: 4 additions & 3 deletions tools/view_stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#This utility prints PyHSS stats stored in Redis
# This utility prints PyHSS stats stored in Redis
import yaml
import sys
with open(sys.path[0] + '/../config.yaml') as stream:
Expand All @@ -15,12 +15,13 @@

print("\n\nDiameter Peers:")
ActivePeerDict = r.get('ActivePeerDict')
if len(ActivePeerDict) == 0:
if ActivePeerDict is None or len(ActivePeerDict) == 0:
print("No connected peers.")
sys.exit()
ActivePeerDict = json.loads(ActivePeerDict)

for keys in ActivePeerDict:
print(keys)
for subkeys in ActivePeerDict[keys]:
print("\t" + str(subkeys) + ": \t" + str(ActivePeerDict[keys][subkeys]))
print('\n')
print('\n')

0 comments on commit ead288d

Please sign in to comment.