From: Sandon Van Ness Date: Thu, 1 Aug 2013 19:33:11 +0000 (-0700) Subject: Fix for Debian wheezy (remove vda from block device list) X-Git-Tag: 1.1.0~2009 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88b7d02970431bf7efbd1bba1d50685701924e5c;p=teuthology.git 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 --- diff --git a/teuthology/misc.py b/teuthology/misc.py index 86638e71d..33bdc4ec0 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))