From 57cac788fba4cc053ffec8b945cc072c17c1e01b Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Mon, 11 Feb 2013 23:24:47 +0100 Subject: [PATCH] Fix setup when /sys/block is inaccessible --- library/setup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/setup b/library/setup index 82e21da845..1d0c05d552 100644 --- a/library/setup +++ b/library/setup @@ -381,7 +381,12 @@ class LinuxHardware(Hardware): if lspci: rc, pcidata, err = module.run_command(lspci) - for block in os.listdir("/sys/block"): + try: + block_devs = os.listdir("/sys/block") + except OSError: + return + + for block in block_devs: virtual = 0 sysfs_no_links = 0 try: