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

Python utils.check_completion_code函数代码示例

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

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



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

示例1: set_lan_configuration_parameters

 def set_lan_configuration_parameters(self, channel, parameter_selector, data):
     req = create_request_by_name('SetLanConfigurationParameters')
     req.command.channel_number = channel
     req.parameter_selector = parameter_selector
     req.data = data
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:7,代码来源:lan.py


示例2: _get_sdr_chunk

    def _get_sdr_chunk(self, reservation_id, record_id, offset, length):
        print length
        req = create_request_by_name('GetSdr')
        req.reservation_id = reservation_id
        req.record_id = record_id
        req.offset = offset
        req.bytes_to_read = length
        retry = 5

        while True:
            retry -= 1
            if retry == 0:
                raise RetryError()
            rsp = self.send_message(req)
            if rsp.completion_code == constants.CC_OK:
                break
            elif rsp.completion_code == constants.CC_RES_CANCELED:
                req.reservation_id = self.reserve_sdr_repository()
                time.sleep(0.1)
                continue
            elif rsp.completion_code == constants.CC_TIMEOUT:
                time.sleep(0.1)
                continue
            elif rsp.completion_code == constants.CC_RESP_COULD_NOT_BE_PRV:
                time.sleep(0.1 * retry)
                continue
            else:
                check_completion_code(rsp.completion_code)

        return (rsp.next_record_id, rsp.data)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:30,代码来源:sdr.py


示例3: clear_fru_deactivation_lock

 def clear_fru_deactivation_lock(self, fru_id):
     req = create_request_by_name('SetFruActivationPolicy')
     req.fru_id = fru_id
     req.mask.deactivation_locked = 1
     req.set.deactivation_locked = 0
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py


示例4: get_signaling_class

 def get_signaling_class(self, interface, channel):
     req = create_request_by_name('GetSignalingClass')
     req.channel_info.channel_number = channel
     req.channel_info.interface = interface
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     return rsp.channel_signaling.class_capability
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py


示例5: get_power_channel_status

 def get_power_channel_status(self, starting_number):
     req = create_request_by_name('GetPowerChannelStatus')
     req.starting_power_channel_number = starting_number
     req.power_channel_count = 1
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     return PowerChannelStatus(rsp.data[0])
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py


示例6: fru_control

 def fru_control(self, fru_id, option):
     req = create_request_by_name('FruControl')
     req.fru_id = fru_id
     req.option = option
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     return rsp.rsp_data
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py


示例7: set_sensor_thresholds

    def set_sensor_thresholds(self, sensor_number, lun=0, unr=None, ucr=None,
                unc=None, lnc=None, lcr=None, lnr=None):
        """Set the sensor thresholds that are not 'None'

        `sensor_number`
        `unr` for upper non-recoverable
        `ucr` for upper critical
        `unc` for upper non-critical
        `lnc` for lower non-critical
        `lcr` for lower critical
        `lnr` for lower non-recoverable
        """
        req = create_request_by_name('SetSensorThresholds')
        req.sensor_number = sensor_number
        req.lun = lun

        thresholds = dict(unr=unr, ucr=ucr, unc=unc, lnc=lnc, lcr=lcr, lnr=lnr)

        for k, v in thresholds.items():
            if v is not None:
                setattr(req.set_mask, k, 1)
                setattr(req.threshold, k, v)

        rsp = self.send_message(req)
        check_completion_code(rsp.completion_code)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:25,代码来源:sensor.py


示例8: set_sensor_thresholds

    def set_sensor_thresholds(self, sensor_number, lun=0, unr=None, ucr=None,
                unc=None, lnc=None, lcr=None, lnr=None):
        """Set the sensor thresholds that are not 'None'

        `sensor_number`
        `unr` for upper non-recoverable
        `ucr` for upper critical
        `unc` for upper non-critical
        `lnc` for lower non-critical
        `lcr` for lower critical
        `lnr` for lower non-recoverable
        """
        req = create_request_by_name('SetSensorThresholds')
        req.sensor_number = sensor_number
        req.lun = lun
        if unr is not None:
            req.set_mask.unr = 1
            req.threshold.unr = unr
        if ucr is not None:
            req.set_mask.ucr = 1
            req.threshold.ucr = ucr
        if unc is not None:
            req.set_mask.unc = 1
            req.threshold.unc = unc
        if lnc is not None:
            req.set_mask.lnc = 1
            req.threshold.lnc = lnc
        if lcr is not None:
            req.set_mask.lcr = 1
            req.threshold.lcr = lcr
        if lnr is not None:
            req.set_mask.lnr = 1
            req.threshold.lnr = lnr
        rsp = self.send_message(req)
        check_completion_code(rsp.completion_code)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:35,代码来源:sensor.py


示例9: get_power_level

 def get_power_level(self, fru_id, power_type):
     req = create_request_by_name('GetPowerLevel')
     req.fru_id = fru_id
     req.power_type = power_type
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     return PowerLevel(rsp)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py


示例10: rearm_sensor_events

 def rearm_sensor_events(self, sensor_number):
     """Rearm sensor events for the given sensor number.
     """
     req = create_request_by_name('RearmSensorEvents')
     req.sensor_number = sensor_number
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:7,代码来源:sensor.py


示例11: get_led_state

 def get_led_state(self, fru_id, led_id):
     req = create_request_by_name('GetFruLedState')
     req.fru_id = fru_id
     req.led_id = led_id
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     return LedState(rsp)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py


示例12: _clear_sdr_repository

 def _clear_sdr_repository(self, cmd, reservation_id):
     req = create_request_by_name('ClearSdrRepository')
     req.reservation_id = reservation_id
     req.cmd = cmd
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     return rsp.status.erase_in_progress
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:7,代码来源:sdr.py


示例13: get_event_receiver

 def get_event_receiver(self):
     req = create_request_by_name('GetEventReceiver')
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     ipmb_address = rsp.event_receiver.ipmb_i2c_slave_address
     lun = rsp.event_receiver.lun
     return (ipmb_address, lun)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:7,代码来源:event.py


示例14: send_message_with_name

    def send_message_with_name(self, name, *args, **kwargs):
        req = create_request_by_name(name)

        for k, v in kwargs.items():
            setattr(req, k, v)

        rsp = self.send_message(req)
        check_completion_code(rsp.completion_code)
        return rsp
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:9,代码来源:__init__.py


示例15: get_fan_level

 def get_fan_level(self, fru_id):
     req = create_request_by_name('GetFanLevel')
     req.fru_id = fru_id
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     local_control_fan_level = None
     if rsp.data:
         local_control_fan_level = rsp.data[0]
     return (rsp.override_fan_level, local_control_fan_level)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:9,代码来源:picmg.py


示例16: write_fru_data

    def write_fru_data(self, data, offset=0, fru_id=0):
        req = create_request_by_name('WriteFruData')
        req.fru_id = fru_id

        for chunk in chunks(data, self.write_length):
            req.offset = offset
            req.data = chunk
            rsp = self.send_message(req)
            check_completion_code(rsp.completion_code)
            offset += len(chunk)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:10,代码来源:fru.py


示例17: delete_sdr

    def delete_sdr(self, record_id):
        """Deletes the sensor record specified by 'record_id'.
        """

        reservation_id = self.reserve_device_sdr_repository()
        req = create_request_by_name('DeleteSdr')
        req.reservation_id = reservation_id
        req.record_id = record_id
        rsp = self.send_message(req)
        check_completion_code(rsp.completion_code)
        return rsp.record_id
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:11,代码来源:sdr.py


示例18: i2c_write_read

 def i2c_write_read(self, type, id, channel, address, count, data=None):
     req = create_request_by_name('MasterWriteRead')
     req.bus_id.type = type
     req.bus_id.id= id
     req.bus_id.channel = channel
     req.bus_id.slave_address = address
     req.read_count = count
     if data:
         req.data = data
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     return rsp.data
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:12,代码来源:bmc.py


示例19: get_lan_configuration_parameters

 def get_lan_configuration_parameters(self, channel=0, parameter_selector=0,
         set_selector=0, block_selector=0, revision_only=0):
     req = create_request_by_name('GetLanConfigurationParameters')
     req.command.get_parameter_revision_only = revision_only
     if revision_only is not 1:
         req.command.channel_number = channel
         req.parameter_selector = parameter_selector
         req.set_selector = set_selector
         req.block_selector = block_selector
     rsp = self.send_message(req)
     check_completion_code(rsp.completion_code)
     return rsp.data
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:12,代码来源:lan.py


示例20: partial_add_sdr

    def partial_add_sdr(self,
                reservation_id, record_id, offset, progress, data):

        req = create_request_by_name('PartialAddSdr')
        req.reservation_id = reservation_id
        req.record_id = record_id
        req.offset = offset
        req.status.in_progress = progress
        req.data = data
        rsp = self.send_message(req)
        check_completion_code(rsp.completion_code)
        return rsp.record_id
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:12,代码来源:sdr.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python pyiso.client_factory函数代码示例发布时间:2022-05-25
下一篇:
Python msgs.encode_message函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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