Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/libcloud/common/__pycache__/openstack.cpython-39.pyc
Ðазад
a q�h;I � @ s� d Z ddlmZ ddlmZ ddlmZmZ ddlmZ ddl m Z mZ ddl mZ ddl mZ dd l mZmZ zdd lZW n ey� dd lZY n0 dZg d�Zg d �ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zd S )z Common utilities for OpenStack � )�ET)�httplib)�ConnectionUserAndKey�Response)� ProviderError)� LibcloudError�MalformedResponseError)�KeyPairDoesNotExistError)�get_class_for_auth_version)�OpenStackServiceCatalog�OpenStackIdentityTokenScopeN�1.1)r z2.0� 2.0_apikey�2.0_passwordz3.xz3.x_password)�OpenStackBaseConnection�OpenStackResponse�OpenStackException�OpenStackDriverMixinc s� e Zd ZdZdZdZdZdZdZdZ dZ dZdZdZ dddddddddejddddddddf� fdd� Zdd � Zd� fd d� Zdd� Zdd� Zdd� Zdd� Zdd� Z� fdd�Zdd� Zdd� Z� ZS ) r a Base class for OpenStack connections. :param user_id: User name to use when authenticating :type user_id: ``str`` :param key: Secret to use when authenticating. :type key: ``str`` :param secure: Use HTTPS? (True by default.) :type secure: ``bool`` :param ex_force_base_url: Base URL for connection requests. If not specified, this will be determined by authenticating. :type ex_force_base_url: ``str`` :param ex_force_auth_url: Base URL for authentication requests. :type ex_force_auth_url: ``str`` :param ex_force_auth_version: Authentication version to use. If not specified, defaults to AUTH_API_VERSION. :type ex_force_auth_version: ``str`` :param ex_force_auth_token: Authentication token to use for connection requests. If specified, the connection will not attempt to authenticate, and the value of ex_force_base_url will be used to determine the base request URL. If ex_force_auth_token is passed in, ex_force_base_url must also be provided. :type ex_force_auth_token: ``str`` :param token_scope: Whether to scope a token to a "project", a "domain" or "unscoped". :type token_scope: ``str`` :param ex_domain_name: When authenticating, provide this domain name to the identity service. A scoped token will be returned. Some cloud providers require the domain name to be provided at authentication time. Others will use a default domain if none is provided. :type ex_domain_name: ``str`` :param ex_tenant_name: When authenticating, provide this tenant name to the identity service. A scoped token will be returned. Some cloud providers require the tenant name to be provided at authentication time. Others will use a default tenant if none is provided. :type ex_tenant_name: ``str`` :param ex_tenant_domain_id: When authenticating, provide this tenant domain id to the identity service. A scoped token will be returned. Some cloud providers require the tenant domain id to be provided at authentication time. Others will use a default tenant domain id if none is provided. :type ex_tenant_domain_id: ``str`` :param ex_force_service_type: Service type to use when selecting an service. If not specified, a provider specific default will be used. :type ex_force_service_type: ``str`` :param ex_force_service_name: Service name to use when selecting an service. If not specified, a provider specific default will be used. :type ex_force_service_name: ``str`` :param ex_force_service_region: Region to use when selecting an service. If not specified, a provider specific default will be used. :type ex_force_service_region: ``str`` NT�Default�defaultc s� t t| �j|||||||d� | r(| | _|| _|| _| | _|| _|| _| | _ || _ || _|| _|| _ || _d | _|r�|s�td��|r�|| _| js�t| _| �� }|s�td��d S )N)�secure�timeout�retry_delay�backoff� proxy_urlzHMust also provide ex_force_base_url when specifying ex_force_auth_token.z)OpenStack instance must have auth_url set)�superr �__init__� _auth_version�base_url�_ex_force_base_url�_ex_force_auth_url�_ex_force_auth_token�_ex_token_scope�_ex_domain_name�_ex_tenant_name�_ex_tenant_domain_id�_ex_force_service_type�_ex_force_service_name�_ex_force_service_region�_osar � auth_token�AUTH_API_VERSION� _get_auth_url)�self�user_id�keyr �host�portr r �ex_force_base_url�ex_force_auth_url�ex_force_auth_version�ex_force_auth_token�ex_token_scope�ex_domain_name�ex_tenant_name�ex_tenant_domain_id�ex_force_service_type�ex_force_service_name�ex_force_service_regionr r �auth_url�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/libcloud/common/openstack.pyr � s: ��z OpenStackBaseConnection.__init__c C sN | j sH| �� }t| jd�}||| j| j| j| j| j| j | j | j| d� | _ | j S )zz Retrieve identity / authentication class instance. :rtype: :class:`OpenStackIdentityConnection` )�auth_version) r= r. r/ Ztenant_nameZtenant_domain_idZdomain_nameZtoken_scoper r Zparent_conn)r) r, r r r. r/ r$ r% r# r"