Skip to content

Commit 0abf354

Browse files
committed
[queuestat CLI] Enable queuestat to get counters with missing data
If self.db.get returns an empty string due to missing fields in countersDB, queuestat will crash instead of setting STATUS_NA. Fixed this problem by checking if counter_data == '' Signed-off-by: Roy Yi <[email protected]>
1 parent 33e85d3 commit 0abf354

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/queuestat

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class Queuestat(object):
182182
for counter_name, pos in counter_bucket_dict.items():
183183
full_table_id = COUNTER_TABLE_PREFIX + table_id
184184
counter_data = self.db.get(self.db.COUNTERS_DB, full_table_id, counter_name)
185-
if counter_data is None:
185+
if counter_data is None or counter_data == ''::
186186
fields[pos] = STATUS_NA
187187
elif fields[pos] != STATUS_NA:
188188
fields[pos] = str(int(counter_data))

0 commit comments

Comments
 (0)