Skip to content

Commit

Permalink
Exclude floppy disks from lsblk call for uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Roth authored and abadger committed Nov 3, 2016
1 parent 7ff9942 commit 6ca6a9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ansible/module_utils/facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,11 @@ def get_dmi_facts(self):
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
Expand Down

0 comments on commit 6ca6a9a

Please sign in to comment.