From 88b7d02970431bf7efbd1bba1d50685701924e5c Mon Sep 17 00:00:00 2001 From: Sandon Van Ness Date: Thu, 1 Aug 2013 12:33:11 -0700 Subject: [PATCH] Fix for Debian wheezy (remove vda from block device list) On debian wheezy its mount output uses device-by-label and makes our normal method of checking if a device is mounted not work. Since vm's will always be vda for their boot device we will just remove it from devs if its in there so it doesn't attempt to zap vda. I also added a strip() to remove the last blank entry that was always getting added to the devs list on all machines. Example: devs=['/dev/sda', '/dev/sdb', '/dev/sdc', '/dev/sdd', ''] Signed-off-by: Sandon Van Ness Reviewed-by: Alfredo Deza --- teuthology/misc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index 86638e71d6df1..33bdc4ec0735c 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -603,7 +603,13 @@ def get_scratch_devices(remote): args=['ls', run.Raw('/dev/[sv]d?')], stdout=StringIO() ) - devs = r.stdout.getvalue().split('\n') + devs = r.stdout.getvalue().strip().split('\n') + + #Remove root device (vm guests) from the disk list + for dev in devs: + if 'vda' in dev: + devs.remove(dev) + log.warn("Removing root device: %s from device list" % dev) log.debug('devs={d}'.format(d=devs)) -- 2.39.5