def blockDev(self): if self._blockDev is None: if self.networkDev or self.device in ("cdrom", "floppy"): self._blockDev = False else: try: self._blockDev = utils.isBlockDevice(self.path) except Exception: self.log.debug("Unable to determine if the path '%s' is a " "block device", self.path, exc_info=True) return self._blockDev
def blockDev(self): if self.networkDev: return False if self._blockDev is None: try: self._blockDev = utils.isBlockDevice(self.path) except Exception: self.log.debug("Unable to determine if the path '%s' is a " "block device", self.path, exc_info=True) return self._blockDev
def diskType(self): """ Return diskType sent by engine, or try to check the disk type by looking at storage. If storage is not available at this point, this will fail with OSError, and diskType will remain undefined. Drive cannot be functional at this state until storage becomes available, and diskType initialized. """ if self._diskType is None: if (self.device in ("cdrom", "floppy") or not utils.isBlockDevice(self.path)): self.diskType = DISK_TYPE.FILE else: self.diskType = DISK_TYPE.BLOCK return self._diskType