def getVolumePath(self): """ Get the path of the volume file/link """ if not self._volumePath: raise se.VolumeAccessError(self.volUUID) return self._volumePath
def llPrepare(self, rw=False, setrw=False): """ Make volume accessible as readonly (internal) or readwrite (leaf) """ volPath = self.getVolumePath() # Volumes leaves created in 2.2 did not have group writeable bit # set. We have to set it here if we want qemu-kvm to write to old # NFS volumes. self.oop.fileUtils.copyUserModeToGroup(volPath) if setrw: self.setrw(rw=rw) if rw: if not self.oop.os.access(volPath, os.R_OK | os.W_OK): raise se.VolumeAccessError(volPath) else: if not self.oop.os.access(volPath, os.R_OK): raise se.VolumeAccessError(volPath)