BmapCopy: do not check for os.path.exists exceptions
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Mon, 14 Jan 2013 14:16:20 +0000 (16:16 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Mon, 14 Jan 2013 14:16:20 +0000 (16:16 +0200)
It is very unlikely that it fails, but if it does, we'll just have an unhandled
exception, which is fine in this case.

Change-Id: If89940b0e38ed9874380788c088f44e733d6435f
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/BmapCopy.py

index 92532dc..e98a594 100644 (file)
@@ -621,12 +621,8 @@ class BmapBdevCopy(BmapCopy):
         # Check if the 'queue' sub-directory exists. If yes, then our block
         # device is entire disk. Otherwise, it is a partition, in which case we
         # need to go one level up in the sysfs hierarchy.
-        try:
-            if not os.path.exists(self._sysfs_base + "queue"):
-                self._sysfs_base = self._sysfs_base + "../"
-        except OSError:
-            # No problem, this is just an optimization.
-            pass
+        if not os.path.exists(self._sysfs_base + "queue"):
+            self._sysfs_base = self._sysfs_base + "../"
 
         self._sysfs_scheduler_path = self._sysfs_base + "queue/scheduler"
         self._sysfs_max_ratio_path = self._sysfs_base + "bdi/max_ratio"