1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Exclude floppy disks from lsblk call for uuids

Fixes #18326
This commit is contained in:
Robin Roth 2016-11-03 08:53:10 +01:00 committed by Toshio Kuratomi
parent 7ff9942ec6
commit 6ca6a9a291

View file

@ -1228,7 +1228,11 @@ class LinuxHardware(Hardware):
self.facts[k] = 'NA'
def _run_lsblk(self, lsblk_path):
args = ['--list', '--noheadings', '--paths', '--output', 'NAME,UUID']
# call lsblk and collect all uuids
# --exclude 2 makes lsblk ignore floppy disks, which are slower to answer than typical timeouts
# this uses the linux major device number
# for details see https://www.kernel.org/doc/Documentation/devices.txt
args = ['--list', '--noheadings', '--paths', '--output', 'NAME,UUID', '--exclude', '2']
cmd = [lsblk_path] + args
rc, out, err = self.module.run_command(cmd)
return rc, out, err