Bug 2225268

Summary: Key error in nfsiostats in line "if "fstype autofs" not in str(old[device])"
Product: Red Hat Enterprise Linux 8 Reporter: Paulo Andrade <pandrade>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: NEW --- QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.8CC: xzhou, yieli
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paulo Andrade 2023-07-24 20:19:32 UTC
There is already a patch named nfs-utils-2.3.3-nfsiostat-key-error.patch
but it does not cover the issue found by user:

Traceback (most recent call last):
  File "/usr/sbin/nfsiostat", line 667, in <module>
    iostat_command(prog)
  File "/usr/sbin/nfsiostat", line 635, in iostat_command
    print_iostat_summary(old_mountstats, mountstats, devices, sample_time, options)
  File "/usr/sbin/nfsiostat", line 475, in print_iostat_summary
    if "fstype autofs" not in str(old[device]):
KeyError: '/home/someuser

  Untested, this pseudo patch should work:

-            if "fstype autofs" not in str(old[device]):
+            if device in old and "fstype autofs" not in str(old[device]):

  If this condition should not happen, please suggest a way to debug what did lead to it.