]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Revert "misc: ignore some unusable block devices" 780/head
authorZack Cerza <zack@cerza.org>
Wed, 27 Jan 2016 22:30:04 +0000 (15:30 -0700)
committerZack Cerza <zack@cerza.org>
Wed, 27 Jan 2016 22:30:04 +0000 (15:30 -0700)
teuthology/misc.py

index 2a0e004e9fc4997b9f626baf7e45e43f05459e7a..4eef301c3a9284dab69aa36878a09430d0f137ee 100644 (file)
@@ -823,7 +823,6 @@ def get_scratch_devices(remote):
     Read the scratch disk list from remote host
     """
     devs = []
-    dev_blkid_data = {}
     try:
         file_data = get_file(remote, "/scratch_devs")
         devs = file_data.split()
@@ -834,77 +833,11 @@ def get_scratch_devices(remote):
         )
         devs = r.stdout.getvalue().strip().split('\n')
 
-    # Look for disks that we need to not touch based on various properties.
+    # Remove root device (vm guests) from the disk list
     for dev in devs:
-        # Remove root device (vm guests) from the disk list
         if 'vda' in dev:
             devs.remove(dev)
             log.warn("Removing root device: %s from device list" % dev)
-            continue
-
-        # Remove read-only devices, based on sysfs
-        sysfsdev = dev.replace('/dev/', '')
-        try:
-            sysfspath = "/sys/block/%s/ro" % (sysfsdev, )
-            rofile = get_file(remote, sysfspath).strip()
-            if rofile is '1':
-                devs.remove(dev)
-                log.warn("Removing read-only device: %s" % (dev, ))
-                continue
-        except Exception:
-            pass
-
-        # Fetch blkid data for the device
-        r = remote.run(
-            args=['sudo', 'blkid', '-o', 'export', '-p', dev],
-            stdout=StringIO(),
-            stderr=StringIO(),
-            check_status=False,
-        )
-        blkid_stderr = r.stderr.getvalue().strip()
-
-        # retval 2 -> does not exist
-        if r.exitstatus == 2:
-            devs.remove(dev)
-            continue
-
-        if len(blkid_stderr) > 0 or r.exitstatus != 0:
-            devs.remove(dev)
-            log.warn("Removing device due to blkid failure: %s: %s"
-                     % (dev, blkid_stderr))
-            continue
-
-        dev_blkid_data[dev] = \
-                dict([_.strip().split('=', 2)
-                     for _ in r.stdout.getvalue().split('\n')])
-        # Look for cloud-init stuff to ignore
-        # cloud-init part1:
-        # Ignore all CDROMs, as they are quite common:
-        # - config-drive
-        # - OpenNubula
-        # - NoCloud
-        # - vSphere
-        # - OVF
-        if 'TYPE' in dev_blkid_data[dev] and \
-                dev_blkid_data[dev]['TYPE'] is 'iso9660':
-            devs.remove(dev)
-            log.warn("Removing cloud-init device by cdrom: %s" % (dev, ))
-
-        # cloud-init, part3:
-        # Disk labels
-        # - "config-2": ConfigDrive v2
-        # - "cidata": NoCloud
-        # - "CONTEXT", "CDROM": OpenNebula
-        if 'LABEL' in dev_blkid_data[dev] and \
-                dev_blkid_data[dev]['LABEL'] \
-                in ['config-2', 'cidata', 'CONTEXT', 'CDROM']:
-            log.warn("Removing cloud-init device by label: %s" % (dev, ))
-            devs.remove(dev)
-
-        # cloud-init, part2:
-        # filenames on a volume
-        # TODO: this requires mounting the filesystem
-        pass
 
     log.debug('devs={d}'.format(d=devs))