• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python log.debug函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中xen.xend.XendLogging.log.debug函数的典型用法代码示例。如果您正苦于以下问题:Python debug函数的具体用法?Python debug怎么用?Python debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了debug函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: waitForDevice

    def waitForDevice(self, devid):
        log.debug("Waiting for %s.", devid)
        
        status = self.waitForBackend(devid)

        if status == Timeout:
            self.destroyDevice(devid)
            raise VmError("Device %s (%s) could not be connected. "
                          "Hotplug scripts not working." %
                          (devid, self.deviceClass))

        elif status == Error:
            self.destroyDevice(devid)
            raise VmError("Device %s (%s) could not be connected. "
                          "Backend device not found." %
                          (devid, self.deviceClass))

        elif status == Missing:
            # Don't try to destroy the device; it's already gone away.
            raise VmError("Device %s (%s) could not be connected. "
                          "Device not found." % (devid, self.deviceClass))

        elif status == Busy:
            err = None
            frontpath = self.frontendPath(devid)
            backpath = xstransact.Read(frontpath, "backend")
            if backpath:
                err = xstransact.Read(backpath, HOTPLUG_ERROR_NODE)
            if not err:
                err = "Busy."
                
            self.destroyDevice(devid)
            raise VmError("Device %s (%s) could not be connected.\n%s" %
                          (devid, self.deviceClass, err))
开发者ID:andreiw,项目名称:xen3-arm-tegra,代码行数:34,代码来源:DevController.py


示例2: waitForBackend

    def waitForBackend(self, devid):

        frontpath = self.frontendPath(devid)
        # lookup a phantom 
        phantomPath = xstransact.Read(frontpath, 'phantom_vbd')
        if phantomPath is not None:
            log.debug("Waiting for %s's phantom %s.", devid, phantomPath)
            statusPath = phantomPath + '/' + HOTPLUG_STATUS_NODE
            ev = Event()
            result = { 'status': Timeout }
            xswatch(statusPath, hotplugStatusCallback, ev, result)
            ev.wait(DEVICE_CREATE_TIMEOUT)
            err = xstransact.Read(statusPath, HOTPLUG_ERROR_NODE)
            if result['status'] != 'Connected':
                return (result['status'], err)
            
        backpath = xstransact.Read(frontpath, "backend")


        if backpath:
            statusPath = backpath + '/' + HOTPLUG_STATUS_NODE
            ev = Event()
            result = { 'status': Timeout }

            xswatch(statusPath, hotplugStatusCallback, ev, result)

            ev.wait(DEVICE_CREATE_TIMEOUT)

            err = xstransact.Read(backpath, HOTPLUG_ERROR_NODE)

            return (result['status'], err)
        else:
            return (Missing, None)
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:33,代码来源:DevController.py


示例3: createSocket

    def createSocket(self):
        from OpenSSL import SSL
        # make a SSL socket
        ctx = SSL.Context(SSL.SSLv23_METHOD)
        ctx.set_options(SSL.OP_NO_SSLv2)
        ctx.use_privatekey_file (self.ssl_key_file)
        ctx.use_certificate_file(self.ssl_cert_file)
        sock = SSL.Connection(ctx,
                              socket.socket(socket.AF_INET, socket.SOCK_STREAM))
        sock.set_accept_state()
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

        # SO_REUSEADDR does not always ensure that we do not get an address
        # in use error when restarted quickly
        # we implement a timeout to try and avoid failing unnecessarily
        timeout = time.time() + 30
        while True:
            try:
                if not self.isValidIP(self.interface):
                    self.interface = self.getIfAddr(self.interface)
                log.debug("Listening on %s:%s" % (self.interface, self.port))
                sock.bind((self.interface, self.port))
                return sock
            except socket.error, (_errno, strerrno):
                if _errno == errno.EADDRINUSE and time.time() < timeout:
                    time.sleep(0.5)
                else:
                    raise
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:28,代码来源:tcp.py


示例4: show_dict

 def show_dict(self,dict=None):
     if self.debug == 0 :
         return
     if dict == None :
         dict = self.udi_dict
     for key in dict:
         log.debug('udi_info %s udi_info:%s',key,dict[key])
开发者ID:changliwei,项目名称:suse_xen,代码行数:7,代码来源:HalDaemon.py


示例5: recv2fd

 def recv2fd(sock, fd):
     try:
         while True:
             try:
                 data = sock.recv(BUFFER_SIZE)
                 if data == "":
                     break
                 count = 0
                 while count < len(data):
                     try:
                         nbytes = os.write(fd, data[count:])
                         count += nbytes
                     except os.error, ex:
                         if ex.args[0] not in (EWOULDBLOCK, EAGAIN, EINTR):
                             raise
             except socket.error, ex:
                 if ex.args[0] not in (EWOULDBLOCK, EAGAIN, EINTR):
                     break
             except (SSL.WantReadError, SSL.WantWriteError, \
                     SSL.WantX509LookupError):
                 # The operation did not complete; the same I/O method
                 # should be called again.
                 continue
             except SSL.ZeroReturnError:
                 # The SSL Connection has been closed.
                 break
             except SSL.SysCallError, (retval, desc):
                 if ((retval == -1 and desc == "Unexpected EOF")
                     or retval > 0):
                     # The SSL Connection is lost.
                     break
                 log.debug("SSL SysCallError:%d:%s" % (retval, desc))
                 break
开发者ID:jeffchao,项目名称:xen-3.3-tcg,代码行数:33,代码来源:connection.py


示例6: fd2send

 def fd2send(sock, fd):
     try:
         while True:
             try:
                 data = os.read(fd, BUFFER_SIZE)
                 if data == "":
                     break
                 count = 0
                 while count < len(data):
                     try:
                         nbytes = sock.send(data[count:])
                         count += nbytes
                     except socket.error, ex:
                         if ex.args[0] not in (EWOULDBLOCK, EAGAIN, EINTR):
                             raise
                     except (SSL.WantReadError, SSL.WantWriteError, \
                             SSL.WantX509LookupError):
                         # The operation did not complete; the same I/O method
                         # should be called again.
                         continue
                     except SSL.ZeroReturnError:
                         # The SSL Connection has been closed.
                         raise
                     except SSL.SysCallError, (retval, desc):
                         if not (retval == -1 and data == ""):
                             # errors when writing empty strings are expected
                             # and can be ignored
                             log.debug("SSL SysCallError:%d:%s" % (retval, desc))
                             raise
                     except SSL.Error, e:
                         # other SSL errors
                         log.debug("SSL Error:%s" % e)
                         raise
开发者ID:jeffchao,项目名称:xen-3.3-tcg,代码行数:33,代码来源:connection.py


示例7: device_added_callback

 def device_added_callback(self,udi):
     log.debug('UDI %s was added', udi)
     self.show_dict(self.udi_dict)
     dev_obj = self.bus.get_object ('org.freedesktop.Hal', udi)
     dev = dbus.Interface (dev_obj, 'org.freedesktop.Hal.Device')
     device = dev.GetProperty ('block.device')
     major = dev.GetProperty ('block.major')
     minor = dev.GetProperty ('block.minor')
     udi_info = {}
     udi_info['device'] = device
     udi_info['major'] = major
     udi_info['minor'] = minor
     udi_info['udi'] = udi
     already = 0
     cnt = 0;
     for key in self.udi_dict:
         info = self.udi_dict[key]
         if info['udi'] == udi:
             already = 1
             break
         cnt = cnt + 1
     if already == 0:
        self.udi_dict[cnt] = udi_info;
        log.debug('UDI %s was added, device:%s major:%s minor:%s index:%d\n', udi, device, major, minor, cnt)
     self.change_xenstore( "add", device, major, minor)
开发者ID:changliwei,项目名称:suse_xen,代码行数:25,代码来源:HalDaemon.py


示例8: __matchPCIdev

 def __matchPCIdev( self, list ):
     ret = False
     if list == None:
         return False
     for id in list:
         if id.startswith(self.devid[:9]): # id's vendor and device ID match
             skey = id.split(':')
             size = len(skey)
             if (size == 2): # subvendor/subdevice not suplied
                 ret = True
                 break
             elif (size == 4): # check subvendor/subdevice
                 # check subvendor
                 subven = '%04x' % self.subvendor
                 if ((skey[2] != 'FFFF') and 
                     (skey[2] != 'ffff') and 
                     (skey[2] != subven)):
                         continue
                 # check subdevice
                 subdev = '%04x' % self.subdevice
                 if ((skey[3] != 'FFFF') and 
                     (skey[3] != 'ffff') and 
                     (skey[3] != subdev)):
                         continue
                 ret = True
                 break
             else:
                 log.debug("WARNING: invalid configuration entry: %s" % id)
                 ret = False
                 break
     return ret
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:31,代码来源:pciquirk.py


示例9: do_FLR_for_GM45_iGFX

    def do_FLR_for_GM45_iGFX(self):
        reg32 = self.pci_conf_read32(PCI_CAP_IGFX_CAP09_OFFSET)
        if ((reg32 >> 16) & 0x000000FF) != 0x06 or \
            ((reg32 >> 24) & 0x000000F0) != 0x20:
            return

        self.pci_conf_write8(PCI_CAP_IGFX_GDRST_OFFSET, PCI_CAP_IGFX_GDRST)
        for i in range(0, 10):
            time.sleep(0.100)
            reg8 = self.pci_conf_read8(PCI_CAP_IGFX_GDRST_OFFSET)
            if (reg8 & 0x01) == 0:
                break
            if i == 10:
                log.debug("Intel iGFX FLR fail on GM45")
                return

        # This specific reset will hang if the command register does not have
        # memory space access enabled
        cmd = self.pci_conf_read16(PCI_COMMAND)
        self.pci_conf_write16(PCI_COMMAND, (cmd | 0x02))
        af_pos = PCI_CAP_IGFX_CAP09_OFFSET
        self.do_AF_FLR(af_pos)
        self.pci_conf_write16(PCI_COMMAND, cmd)

        log.debug("Intel iGFX FLR on GM45 done")
开发者ID:sudkannan,项目名称:xen-hv,代码行数:25,代码来源:pci.py


示例10: decode

 def decode(self, uri):
     for scheme in self.schemes:
         try:
             # If this passes, it is the correct scheme
             return scheme.decode(uri)
         except scheme_error, se:
             log.debug("Decode throws an error: '%s'" % se)
开发者ID:avsm,项目名称:xen-unstable,代码行数:7,代码来源:fileuri.py


示例11: op_start

 def op_start(self, _, req):
     self.acceptCommand(req)
     paused = False
     if 'paused' in req.args and req.args['paused'] == [1]:
         paused = True
     log.debug("Starting domain " + self.dom.getName() + " " + str(paused))
     return self.xd.domain_start(self.dom.getName(), paused)
开发者ID:a2k2,项目名称:xen-unstable,代码行数:7,代码来源:SrvDomain.py


示例12: get_host_block_device_io

    def get_host_block_device_io(self):
#          iostat | grep "sd*" | awk '{if (NF==6 && ($1 ~ /sd/)) print $1, $(NR-1), $NR}'
        usage_at = time.time()
        cmd = "iostat | grep \"sd*\"| awk '{if (NF==6 && ($1 ~ /sd/)) print $1, $NF-1, $NF}'"
#        log.debug(cmd)
        (rc, stdout, stderr) = doexec(cmd)
        out = stdout.read()
        result = []
        if rc != 0:
            err = stderr.read();
            stderr.close();
            stdout.close();
            log.debug('Failed to excute iostat!error:%s' % err)
            return result
        else:
            try:
                if out:
                    lines = out.split('\n')
                    for line in lines:
                        if line.strip() and len(line.strip().split()) == 3:
                            dev, rd_stat, wr_stat = line.strip().split() 
                            rd_stat = int(rd_stat)                 
                            wr_stat = int(wr_stat)
                            l = (usage_at, dev, rd_stat, wr_stat)
                            result.append(l)
            except Exception, exn:
                log.debug(exn)
            finally:
开发者ID:Hearen,项目名称:OnceServer,代码行数:28,代码来源:XendMonitor.py


示例13: waitForDevice

    def waitForDevice(self, devid):
        log.debug("Waiting for %s.", devid)

        if not self.hotplug:
            return

        (status, err) = self.waitForBackend(devid)

        if status == Timeout:
            self.destroyDevice(devid, False)
            raise VmError("Device %s (%s) could not be connected. "
                          "Hotplug scripts not working." %
                          (devid, self.deviceClass))

        elif status == Error:
            self.destroyDevice(devid, False)
            if err is None:
                raise VmError("Device %s (%s) could not be connected. "
                              "Backend device not found." %
                              (devid, self.deviceClass))
            else:
                raise VmError("Device %s (%s) could not be connected. "
                              "%s" % (devid, self.deviceClass, err))
        elif status == Missing:
            # Don't try to destroy the device; it's already gone away.
            raise VmError("Device %s (%s) could not be connected. "
                          "Device not found." % (devid, self.deviceClass))

        elif status == Busy:
            self.destroyDevice(devid, False)
            if err is None:
                err = "Busy."
            raise VmError("Device %s (%s) could not be connected.\n%s" %
                          (devid, self.deviceClass, err))
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:34,代码来源:DevController.py


示例14: main

 def main(self):
     try:
         while True:
             try:
                 data = self.sock.recv(BUFFER_SIZE)
                 if data == "":
                     break
                 if self.protocol.dataReceived(data):
                     break
             except socket.error, ex:
                 if ex.args[0] not in (EWOULDBLOCK, EAGAIN, EINTR):
                     break
             except (SSL.WantReadError, SSL.WantWriteError, \
                     SSL.WantX509LookupError):
                 # The operation did not complete; the same I/O method
                 # should be called again.
                 continue
             except SSL.ZeroReturnError:
                 # The SSL Connection has been closed.
                 break
             except SSL.SysCallError, (retval, desc):
                 if ((retval == -1 and desc == "Unexpected EOF")
                     or retval > 0):
                     # The SSL Connection is lost.
                     break
                 log.debug("SSL SysCallError:%d:%s" % (retval, desc))
                 break
开发者ID:jeffchao,项目名称:xen-3.3-tcg,代码行数:27,代码来源:connection.py


示例15: forkHelper

def forkHelper(cmd, fd, inputHandler, closeToChild):
    child = xPopen3(cmd, True, -1, [fd])

    if closeToChild:
        child.tochild.close()

    thread = threading.Thread(target = slurp, args = (child.childerr,))
    thread.start()

    try:
        try:
            while 1:
                line = child.fromchild.readline()
                if line == "":
                    break
                else:
                    line = line.rstrip()
                    log.debug('%s', line)
                    inputHandler(line, child.tochild)

        except IOError, exn:
            raise XendError('Error reading from child process for %s: %s' %
                            (cmd, exn))
    finally:
        child.fromchild.close()
        if not closeToChild:
            child.tochild.close()
        thread.join()
        child.childerr.close()
        status = child.wait()

    if status >> 8 == 127:
        raise XendError("%s failed: popen failed" % string.join(cmd))
    elif status != 0:
        raise XendError("%s failed" % string.join(cmd))
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:35,代码来源:XendCheckpoint.py


示例16: waitForDevice_reconfigure

    def waitForDevice_reconfigure(self, devid):
        log.debug("Waiting for %s - reconfigureDevice.", devid)

        (status, err) = self.waitForBackend_reconfigure(devid)

        if status == Timeout:
            raise VmError("Device %s (%s) could not be reconfigured. " %
                          (devid, self.deviceClass))
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:8,代码来源:DevController.py


示例17: run

 def run(self):
     log.debug( "%s", "In new run" );
     try:
         self.mainloop = gobject.MainLoop()
         self.mainloop.run()
     except KeyboardInterrupt, ex:
         log.debug('Keyboard exception handler: %s', ex )
         self.mainloop.quit()
开发者ID:changliwei,项目名称:suse_xen,代码行数:8,代码来源:HalDaemon.py


示例18: recreate_active_pools

    def recreate_active_pools(cls):
        """ Read active pool config from hypervisor and create pool instances.
            - Query pool ids and assigned CPUs from hypervisor.
            - Query additional information for any pool from xenstore.
              If an entry for a pool id is missing in xenstore, it will be
              recreated with a new uuid and generic name (this is an error case)
            - Create an XendCPUPool instance for any pool id
            Function have to be called after recreation of managed pools.
        """
        log.debug('recreate_active_pools')

        for pool_rec in xc.cpupool_getinfo():
            pool = pool_rec['cpupool']

            # read pool data from xenstore
            path = XS_POOLROOT + "%s/" % pool
            uuid = xstransact.Read(path, 'uuid')
            if not uuid:
                # xenstore entry missing / invaild; create entry with new uuid
                uuid = genuuid.createString()
                name = "Pool-%s" % pool
                try:
                    inst = XendCPUPool( { 'name_label' : name }, uuid, False )
                    inst.update_XS(pool)
                except PoolError, ex:
                    # log error and skip domain
                    log.error('cannot recreate pool %s; skipping (reason: %s)' \
                        % (name, ex))
            else:
                (name, descr) = xstransact.Read(path, 'name', 'description')
                other_config = {}
                for key in xstransact.List(path + 'other_config'):
                    other_config[key] = xstransact.Read(
                        path + 'other_config/%s' % key)

                # check existance of pool instance
                inst = XendAPIStore.get(uuid, cls.getClass())
                if inst:
                    # update attributes of existing instance
                    inst.name_label = name
                    inst.name_description = descr
                    inst.other_config = other_config
                else:
                    # recreate instance
                    try:
                        inst = XendCPUPool(
                            { 'name_label' : name,
                              'name_description' : descr,
                              'other_config' : other_config,
                              'proposed_CPUs' : pool_rec['cpulist'],
                              'ncpu' : len(pool_rec['cpulist']),
                            },
                            uuid, False )
                    except PoolError, ex:
                        # log error and skip domain
                        log.error(
                            'cannot recreate pool %s; skipping (reason: %s)' \
                            % (name, ex))
开发者ID:jinho10,项目名称:d-pride,代码行数:58,代码来源:XendCPUPool.py


示例19: __sendPermDevs

 def __sendPermDevs(self):
     if self.__devIsUnconstrained():
         log.debug("Unconstrained device: %04x:%02x:%02x.%1x" % (self.domain, self.bus, self.slot, self.func))
         try:
             f = file(PERMISSIVE_SYSFS_NODE, "w")
             f.write("%04x:%02x:%02x.%1x" % (self.domain, self.bus, self.slot, self.func))
             f.close()
         except Exception, e:
             raise VmError("pci: failed to open/write/close permissive " + "sysfs node: " + str(e))
开发者ID:avsm,项目名称:xen-unstable,代码行数:9,代码来源:pciquirk.py


示例20: __sendQuirks

 def __sendQuirks(self):
     for quirk in self.quirks:
         log.debug("Quirk Info: %04x:%02x:%02x.%1x-%s" % (self.domain, self.bus, self.slot, self.func, quirk))
         try:
             f = file(QUIRK_SYSFS_NODE, "w")
             f.write("%04x:%02x:%02x.%1x-%s" % (self.domain, self.bus, self.slot, self.func, quirk))
             f.close()
         except Exception, e:
             raise VmError("pci: failed to open/write/close quirks " + "sysfs node - " + str(e))
开发者ID:avsm,项目名称:xen-unstable,代码行数:9,代码来源:pciquirk.py



注:本文中的xen.xend.XendLogging.log.debug函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python log.exception函数代码示例发布时间:2022-05-26
下一篇:
Python XendBase.XendBase类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap