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

[disk] Convert /dev/root device to real device path #9577

Merged
merged 3 commits into from
Oct 19, 2021

Conversation

albertvaka
Copy link
Contributor

@albertvaka albertvaka commented Oct 19, 2021

What does this PR do?

Backport of upstream PR: giampaolo/psutil#2000

Motivation

On some Linux setups (eg: default Ubuntu 20.04 AWS instances), psutils
would return /dev/root instead of the actual block device (eg: /dev/xvda1).

When using the tag_by_label option, the disk check tries to match the
output of psutil with the output of lsblk or blkid to find disk labels.
However, these return the actual path instead of /dev/root, resulting in
missing tags.

Describe how to test your changes

Run import psutil; psutil.disk_partitions() on both the py2 and py3 interpreters of an Agent running on an Ubuntu 20.04 AWS instance. It should list /dev/xvda1 with this patch and /dev/root without.

Backport of upstream PR: giampaolo/psutil#2000

On some Linux setups (eg: default Ubuntu 20.04 AWS instances), psutils
would return /dev/root instead of the actual block device (eg: /dev/xvda).

When using the `tag_by_label` option, the disk check tries to match the
output of psutil with the output of `lsblk` or `blkid` to find disk labels.
However, these return the actual path instead of /dev/root, resulting in
missing tags.
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Looks good after you add a release note/add the no changelog label

@albertvaka albertvaka merged commit a55c04d into main Oct 19, 2021
@albertvaka albertvaka deleted the albertvaka/psutils-convert-dev-root-path branch October 19, 2021 15:45
zandrewitte pushed a commit to StackVista/stackstate-agent that referenced this pull request Nov 17, 2022
Backport of upstream PR: giampaolo/psutil#2000

On some Linux setups (eg: default Ubuntu 20.04 AWS instances), psutils
would return /dev/root instead of the actual block device (eg: /dev/xvda).

When using the tag_by_label option, the disk check tries to match the
output of psutil with the output of lsblk or blkid to find disk labels.
However, these return the actual path instead of /dev/root, resulting in
missing tags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants