Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pyipmi/interfaces/__pycache__/ipmitool.cpython-39.pyc
Ðазад
a ]�hc* � @ s� d dl Z d dlmZmZ d dlmZ ddlmZ ddlmZm Z ddl mZ ddlm Z mZmZ dd lmZ dd lmZmZmZ G dd� de�ZdS ) � N)�Popen�PIPE)�array� )�Session)�IpmiTimeoutError�IpmiConnectionError)�log)�encode_message�decode_message�create_message)�CC_OK)�py3dec_unic_bytes_fix� ByteBuffer�py3_array_tobytesc @ s� e Zd ZdZdZdZg d�Zd"dd�Zdd � Zd d� Z dd � Z dd� Zdd� Zdd� Z edd� �Zedd� �Zdd� Zdd� Zdd� Zdd� Zed d!� �ZdS )#�Ipmitoola This interface uses the ipmitool raw command. This "emulates" a RMCP session by using raw commands. It uses the session information to assemble the correct ipmitool parameters. Therefore, a session has to be established before any request can be sent. Zipmitool)�lan�lanplus�serial-terminal�openr Nc C s� || j v r|| _ntd| ��|d urFt|�tdd�vrFtd| ��n|| _t�d�| _t�d�| _ t�d�| _ t�d�| _d | _d S ) N�interface type %s not supportedr � z&cipher %s not in allowed range [0-255]z2Unable to send RAW command \(.*rsp=(0x[0-9a-f]+)\)z0Unable to send RAW command \(.*cmd=0x[0-9a-f]+\)z.*Unable to establish.*z.*Could not open device.*) �supported_interfaces�_interface_type�RuntimeError�int�range�_cipher�re�compile�re_completion_code� re_timeout�re_unable_establish�re_could_not_open�_session)�selfZinterface_type�cipher� r'