Did I find the right examples for you? yes no

All Samples(57)  |  Call(57)  |  Derive(0)  |  Import(0)

src/x/c/xcp-storage-managers-HEAD/drivers/lvutil.py   xcp-storage-managers(Download)
def _checkActive(path):
    if util.pathexists(path):
        return True
 
    util.SMlog("_checkActive: %s does not exist!" % path)
 
    mapperPath = "/dev/mapper/" + mapperDevice
    mapperPathExists = util.pathexists(mapperPath)
    util.SMlog("_checkActive: path %s exists: %s" % \
            (mapperPath, mapperPathExists))
 
    if mapperDeviceExists and mapperPathExists and not symlinkExists:
        # we can fix this situation manually here
        os.symlink(mapperPath, path)
        if util.pathexists(path):
            nodeExists = True
 
    if not util.pathexists(mapperPath) and not nodeExists:
        return
 
                    raise e
 
    if util.pathexists(mapperPath):
        os.unlink(mapperPath)
        util.SMlog("_lvmBugCleanup: deleted devmapper file %s" % mapperPath)

src/x/c/xcp-storage-managers-HEAD/drivers/FileSR.py   xcp-storage-managers(Download)
        root of a file-based SR.) """
        try:
            if util.ioretry(lambda: util.pathexists(self.path)):
                if len(util.ioretry(lambda: util.listdir(self.path))) != 0:
                    raise xs_errors.XenError('SRExists')
        # files that are non VDI's
        try:
            if util.ioretry(lambda: util.pathexists(self.path)):
                #Load the VDI list
                self._loadvdis()
    def _checkpath(self, path):
        try:
            if util.ioretry(lambda: util.pathexists(path)):
                if util.ioretry(lambda: util.isdir(path)):
                    return True
            vhd_path = os.path.join(self.sr.path, "%s.%s" % \
                    (vdi_uuid, self.PARAM_VHD))
            if util.ioretry(lambda: util.pathexists(vhd_path)):
                self.vdi_type = vhdutil.VDI_TYPE_VHD
                self.path = vhd_path
                self.path = raw_path
                self.hidden = False
                if not util.ioretry(lambda: util.pathexists(self.path)):
                    if self.sr.srcmd.cmd == "vdi_attach_from_config":
                        return

src/x/c/xcp-storage-managers-HEAD/drivers/ISCSISR.py   xcp-storage-managers(Download)
 
        path = self.mpathmodule.path(SCSIid)
        if not util.pathexists(path):
            self.refresh()
            if not util.wait_for_path(path, MAX_TIMEOUT):

src/x/c/xcp-storage-managers-HEAD/drivers/NFSSR.py   xcp-storage-managers(Download)
 
        newpath = os.path.join(self.path, sr_uuid)
        if util.ioretry(lambda: util.pathexists(newpath)):
            if len(util.ioretry(lambda: util.listdir(newpath))) != 0:
                self.detach(sr_uuid)
            newpath = os.path.join(self.path, sr_uuid)
 
            if util.ioretry(lambda: util.pathexists(newpath)):
                util.ioretry(lambda: os.rmdir(newpath))
            self.detach(sr_uuid)
    def _checkmount(self):
        return util.ioretry(lambda: util.pathexists(self.path)) \
               and util.ioretry(lambda: util.ismount(self.path))
 
    def scan_exports(self, target):
    def generate_config(self, sr_uuid, vdi_uuid):
        util.SMlog("NFSFileVDI.generate_config")
        if not util.pathexists(self.path):
                raise xs_errors.XenError('VDIUnavailable')
        resp = {}
        util.SMlog("NFSFileVDI.attach_from_config")
        try:
            if not util.pathexists(self.sr.path):
                self.sr.attach(sr_uuid)
        except:

src/x/c/xcp-storage-managers-HEAD/drivers/LVHDSR.py   xcp-storage-managers(Download)
        if success:
            try:
                if util.pathexists(self.path):
                    os.rmdir(self.path)
            except Exception, e:
    def _attach(self):
        self._chainSetActive(True, True, True)
        if not util.pathexists(self.path):
            raise xs_errors.XenError('VDIUnavailable', \
                    opterr='Could not find: %s' % self.path)
        # theoretically be anywhere in the chain if all VHDs under it are empty
        self._chainSetActive(True, False)
        if not util.pathexists(self.path):
            raise xs_errors.XenError('VDIUnavailable', \
                    opterr='VDI unavailable: %s' % (self.path))
            lvname = "%s%s" % (lvhdutil.LV_PREFIX[t], self.uuid)
            path = os.path.join(self.sr.path, lvname)
            if util.pathexists(path):
                if found:
                    raise xs_errors.XenError('VDILoad',

src/x/c/xcp-storage-managers-HEAD/drivers/blktap2.py   xcp-storage-managers(Download)
        # Shutdown tapdisk
        back_link = self.BackendLink.from_uuid(sr_uuid, vdi_uuid)
        if not util.pathexists(back_link.path()):
            util.SMlog("Backend path %s does not exist" % back_link.path())
            return
        # read cache
        read_cache_path = "%s/%s.vhdcache" % (local_sr.path, shared_target.uuid)
        if util.pathexists(read_cache_path):
            util.SMlog("Read cache node (%s) already exists, not creating" % \
                    read_cache_path)
        local_leaf_path = "%s/%s.vhdcache" % \
                (local_sr.path, self.target.vdi.uuid)
        if util.pathexists(local_leaf_path):
            util.SMlog("Local leaf node (%s) already exists, deleting" % \
                    local_leaf_path)
        local_leaf_path = "%s/%s.vhdcache" % \
                (local_sr.path, self.target.vdi.uuid)
        if util.pathexists(local_leaf_path):
            util.SMlog("Deleting local leaf node %s" % local_leaf_path)
            os.unlink(local_leaf_path)

src/x/c/xcp-storage-managers-HEAD/drivers/ISOSR.py   xcp-storage-managers(Download)
    def _checkmount(self):
        """Checks that the mountpoint exists and is mounted"""
        if not util.pathexists(self.mountpoint):
            return False
        try:
        self.sm_config['created'] = util._getDateString()
 
        if util.pathexists(self.path):
            raise xs_errors.XenError('VDIExists')
 
        self._db_forget()
 
        if not util.pathexists(self.path):
            return
 

src/x/c/xcp-storage-managers-HEAD/drivers/cleanup.py   xcp-storage-managers(Download)
    def load(self, info = None):
        if not info:
            if not util.pathexists(self.path):
                raise util.SMException("%s not found" % self.path)
            try:
        self.fileName = "%s%s" % (self.uuid, vhdutil.FILE_EXTN_VHD)
        self.path = os.path.join(self.sr.path, self.fileName)
        assert(not util.pathexists(self.path))
        Util.log("Renaming %s -> %s" % (oldPath, self.path))
        os.rename(oldPath, self.path)
    def scan(self, force = False):
        if not util.pathexists(self.path):
            raise util.SMException("directory %s not found!" % self.uuid)
        vhds = self._scan(force)
        for uuid, vhdInfo in vhds.iteritems():

src/x/c/xcp-storage-managers-HEAD/drivers/LUNperVDI.py   xcp-storage-managers(Download)
    def attach(self, sr_uuid, vdi_uuid):
        self.sr._loadvdis()
        if not self.sr.vdis.has_key(vdi_uuid):
            raise xs_errors.XenError('VDIUnavailable')
        if not util.pathexists(self.path):

src/x/c/xcp-storage-managers-HEAD/drivers/ipc.py   xcp-storage-managers(Download)
    def __init__(self, ns):
        self.ns = ns
        self.nsDir = os.path.join(self.BASE_DIR, self.ns)
        if not util.pathexists(self.nsDir):
            try:
                os.makedirs(self.nsDir)
            except OSError:
                pass
        if not util.pathexists(self.nsDir):
    def test(self, name):
        """Test the flag"""
        flagFile = os.path.join(self.nsDir, name)
        return util.pathexists(flagFile)
 

  1 | 2  Next