Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugins][scsi] Enhance data gathering of tape devices #3473

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jcastill
Copy link
Member

  • Add a function to iterate through tape devices, similar to
    _get_block_devs() and _get_fibre_devs(), and
  • Capture udevadm info for tape devices.

Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?

Add get_tape_devs() function and other logic
to iterate and gather information about tape
devices.

Related: sosreport#2463

Signed-off-by: Jose Castillo <[email protected]>
@jcastill
Copy link
Member Author

Draft PR for now because I'm still testing this.
I'll try to get reservation key information as well but it's a bit trickier so far.

Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3473
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@jcastill
Copy link
Member Author

At this point I wonder if it wouldn't be better to have a 'tape' or 'tapes' plugin by itself, like we have for block devices...

'lin_tape'
]
for devdir in devdirs:
if os.path.isdir(f"/sys/class/{devdir}"):
Copy link
Contributor

@pmoravec pmoravec Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant test:

>>> os.path.isdir("/blah")
False
>>> glob.glob("/blah")
[]
>>> 

(purely from performance point of view, I even did a test comparing both approaches. It seems Python spends bit more time in isdir test every time than in (sometimes) running extra glob and adding empty list)

Capture udevadm info for tape devices.

Related: sosreport#2463

Signed-off-by: Jose Castillo <[email protected]>
@jcastill jcastill force-pushed the jcastillo-gather-tapes-information branch from a4bb44c to 063d112 Compare January 15, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants