File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/proxy/__pycache__/cimc.cpython-310.pyc
Back
o ;j$ � @ s� d Z ddlZddlZddlm mZ ddlZdgZ ddiZ i Ze�e �ZdZdd� Zd!dd �Zd d� Zd"d d�Zd#dd�Zdd� Zd!dd�Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � ZdS )$a Proxy Minion interface module for managing Cisco Integrated Management Controller devices ========================================================================================= .. versionadded:: 2018.3.0 :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix This proxy minion enables Cisco Integrated Management Controller devices (hereafter referred to as simply 'cimc' devices to be treated individually like a Salt Minion. The cimc proxy leverages the XML API functionality on the Cisco Integrated Management Controller. The Salt proxy must have access to the cimc on HTTPS (tcp/443). More in-depth conceptual reading on Proxy Minions can be found in the :ref:`Proxy Minion <proxy-minion>` section of Salt's documentation. Configuration ============= To use this integration proxy module, please configure the following: Pillar ------ Proxy minions get their configuration from Salt's Pillar. Every proxy must have a stanza in Pillar and a reference in the Pillar top-file that matches the ID. .. code-block:: yaml proxy: proxytype: cimc host: <ip or dns name of cimc host> username: <cimc username> password: <cimc password> verify_ssl: True proxytype ^^^^^^^^^ The ``proxytype`` key and value pair is critical, as it tells Salt which interface to load from the ``proxy`` directory in Salt's install hierarchy, or from ``/srv/salt/_proxy`` on the Salt Master (if you have created your own proxy module, for example). To use this cimc Proxy Module, set this to ``cimc``. host ^^^^ The location, or ip/dns, of the cimc host. Required. username ^^^^^^^^ The username used to login to the cimc host. Required. password ^^^^^^^^ The password used to login to the cimc host. Required. � NZcimc�vendorZCiscoc C s t S )z7 Only return if all the modules are available. )�__virtualname__� r r �C/opt/saltstack/salt/lib/python3.10/site-packages/salt/proxy/cimc.py�__virtual__Y s r c C s8 t | �}|dvr|rt|� t�d|� tj�d��d S )N)Z200Z201Z202Z204z#Received error HTTP status code: %sz+Did not receive a valid response from host.)�str�logout�log�error�salt� exceptions�CommandExecutionError)Zresponse_code_to_checkZcookie_to_logoutZformatted_response_coder r r �_validate_response_code` s ��r c C s� t �d| � d| d vrt �d� dS d| d vr t �d� dS d| d vr-t �d � dS d �| d d �td<