Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pyipmi/__pycache__/helper.cpython-39.pyc
Ðазад
a ]�hA � @ s^ d dl Z ddlmZmZ ddlmZmZ ddlmZ ddd�Z dd d �Z dd� Zdd d�ZdS )� N� )�CompletionCodeError� RetryError)�check_completion_code� ByteBuffer)� constants� c C s� |d8 }|dkrt � �| |�}|jtjkr.q�q |jtjkrPt�d� |� |_q q |jtjkrjt�d� q q |jtj kr�t�d| � q q t |j� q |S )Nr r g�������?)r Zcompletion_coder ZCC_OK�CC_RES_CANCELED�time�sleep�reservation_idZ CC_TIMEOUTZCC_RESP_COULD_NOT_BE_PRVr )Zsend_fn�req� reserve_fn�retryZrsp� r �}/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pyipmi/helper.py�get_sdr_chunk_helper s$ r c C s< |du r| � }|||dd�\}}t |�}|�d�}|�d�}|�d�}|�d�} | d } t |�}t|�}d} d}|d8 }|dkr�t� �| }|| | kr�| | }z|||||�\}}W nR t�y } z8|jtjkr�| d8 } | dkr�d}n t|j��W Y d}~n d}~0 0 |�|dd� � t|�}t|�| krp�q4qp||fS )z�Helper function to retrieve the sdr data. A specified helper function is used to retrieve the chunks. This can be used for SDRs from the Sensor Device or form the SDR repository. Nr r � r � � ) r Zpop_unsigned_int�lenr r �ccr ZCC_CANT_RET_NUM_REQ_BYTES�extend)r Zget_fnZ record_idr Znext_id�data�headerZrecord_versionZrecord_typeZrecord_payload_lengthZ record_lengthZrecord_data�offsetZmax_req_lenr �length�er r r �get_sdr_data_helper1 s@ r c C s� |d8 }|dkrt � �z|||�}W nX ty| } z@|jtjkr^t�d� | � }W Y d }~q n t|j� W Y d }~n d }~0 0 |tjkr�t�d� q q�q |S )Nr r g�������?� �?) r r r r r r r r ZREPOSITORY_ERASURE_IN_PROGRESS)r �clear_fnZctrlr �reservationZin_progressr r r r �_clear_repositoryg s r"