当前位置: 首页>>代码示例>>Python>>正文


Python utils.check_completion_code函数代码示例

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


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


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