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>
# 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"