Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cinderclient/__pycache__/client.cpython-39.pyc
Ðазад
a t�h} � @ s, d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlm Z ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ e�d�ZddlZddlmZ ddlm m mZ dd lm Z ddl!m"Z" ddl!m#Z# ddl$Z!zddl%m&Z& W n e'�y> ddl(m&Z& Y n0 zddl)Z)W n e'�yh ddl*Z)Y n0 ddgZ+dZ,dZ-e-e,d�Z.dZ/dD ]Z0e�1e0e �2d�d� �q�d8dd�Z3d9dd�Z4dd � Z5d!d"� Z6G d#d$� d$ej7�Z8G d%d&� d&e9�Z:d:d*d+�Z;d,d-� Z<d.d/� Z=d0d1� Z>d2d3� Z?d4d5� Z@d6d7� ZAdS );zAOpenStack Client interface. Handles the REST calls and responses.� )�print_functionN)�access)�adapter)�discover)�base)�encodeutils)�importutils)�strutilszosprofiler.web)�urllib)�_)�api_versions)� exceptions)�sleep�v2�v3�volumev3�volumev2��2�3zX-OpenStack-Request-ID)�volumer r z /v[12]/\w+/?$�/Fc C s@ d}d}t �t�}z�tj�| �}d}dD ]L}|j�|�sHd�|�|jv r(|jd|j� |�� } d|j |j| f } qvq(|s~| }|r�d} n|r�|} nd} tj || d�}t�|j�}|d } | D ].}d |d v r�|d }|d } q�q�d}d}q�W n< tj�y* } z |�d t�|j�� W Y d}~n d}~0 0 t�|�t�|�fS )a� Queries the server via the naked endpoint and gets version info. :param url: url of the cinder endpoint :param insecure: Explicitly allow client to perform "insecure" TLS (https) requests :param cacert: Specify a CA bundle file to use in verifying a TLS (https) server certificate :returns: APIVersion object for min and max version supported by the server z2.0N)r r z/{0}/z %s://%s%sFT)�verify�versionsz3.�version�min_versionz9Error in server version query:%s Returning APIVersion 2.0)�logging� getLogger�__name__r �parse�urlparse�path�endswith�format�rfind�scheme�netloc�requests�get�json�loads�textr �ClientException�warning�six� text_type�messager � APIVersion)�url�insecure�cacertr �current_version�logger�uZversion_url�verr! �verify_cert�response�datar r �e� r= ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cinderclient/client.py�get_server_versionG sF ��r? c C s* t | ||�\}}t�tj�}t||��� S )zCReturns highest supported version by client and server as a string.)r? r r1 ZMAX_VERSION�min� get_string)r2 r3 r4 Z min_serverZ max_serverZ max_clientr= r= r>