aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/arc_summary
diff options
context:
space:
mode:
authorJohnny Stenback <[email protected]>2017-01-03 10:29:23 -0800
committerBrian Behlendorf <[email protected]>2017-01-03 12:29:23 -0600
commit5eac94bffd3b98c585eecfbf3fbf444362573142 (patch)
treeda1b1e28856fd3c096f816433f65a7b6ea98697c /cmd/arc_summary
parent24d42e22211b68f3a6fa514c28ffdfe265d44fef (diff)
Fix TypeError: unorderable types: str() > int() in arc_summary.py
Running arc_summary.py with a l2arc cache device around produces the following error: Traceback (most recent call last): File "/usr/bin/arc_summary.py", line 1148, in <module> main() File "/usr/bin/arc_summary.py", line 1144, in main page(Kstat) File "/usr/bin/arc_summary.py", line 724, in _l2arc_summary arc["l2_arc_evicts"]["reading"] > 0: TypeError: unorderable types: str() > int() This is due to arc["l2_arc_evicts"]['lock_retries'] and arc["l2_arc_evicts"]["reading"] both being strings, returned from fHits() earlier. Rather than adding them up and checking if the result is > 0, this checks if either string is != '0'. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Closes #5538
Diffstat (limited to 'cmd/arc_summary')
-rwxr-xr-xcmd/arc_summary/arc_summary.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/arc_summary/arc_summary.py b/cmd/arc_summary/arc_summary.py
index e7448fa5d..83918a645 100755
--- a/cmd/arc_summary/arc_summary.py
+++ b/cmd/arc_summary/arc_summary.py
@@ -705,8 +705,8 @@ def _l2arc_summary(Kstat):
)
sys.stdout.write("\n")
- if arc["l2_arc_evicts"]['lock_retries'] + \
- arc["l2_arc_evicts"]["reading"] > 0:
+ if arc["l2_arc_evicts"]['lock_retries'] != '0' or \
+ arc["l2_arc_evicts"]["reading"] != '0':
sys.stdout.write("L2 ARC Evicts:\n")
sys.stdout.write("\tLock Retries:\t\t\t\t%s\n" %
arc["l2_arc_evicts"]['lock_retries'])