]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix for Debian wheezy (remove vda from block device list)
authorSandon Van Ness <sandon@inktank.com>
Thu, 1 Aug 2013 19:33:11 +0000 (12:33 -0700)
committerSandon Van Ness <sandon@inktank.com>
Thu, 1 Aug 2013 19:33:11 +0000 (12:33 -0700)
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 <sandon@inktank.com>
Reviewed-by: Alfredo Deza <alfredo@deza.pe>
teuthology/misc.py

index 86638e71d6df1c6b3b20b2dd1bd582b4b5517007..33bdc4ec0735c35b696171fc27f682b675311204 100644 (file)
@@ -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))