File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/libcloud/compute/__pycache__/base.cpython-310.pyc
Back
o ;j7� � @ sP d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlmZm Z mZmZmZmZmZmZmZ ddlZddlmZ ddlmZ ddlmZmZmZ ddlmZm Z m!Z!m"Z" ddl#m$Z$ dd l%m&Z&m'Z'm(Z(m)Z)m*Z* dd l+m,Z,m-Z- er�ddl.m/Z/ e"r�ddl0m1Z1m2Z2 e2e1e3ej4ej5fZ6ne3ej4ej5fZ6ed Z7eee8 e8f Z9dZ:dZ;g d�Z<g d�Z=G dd� d�Z>G dd� de>�Z?G dd� de>�Z@G dd� de>�ZAG dd� de>�ZBG dd� d�ZCG dd� d�ZDG d d!� d!�ZEG d"d#� d#e>�ZFG d$d%� d%�ZGG d&d'� d'�ZHG d(d)� d)e�ZIeJd*k�r&ddlKZKeK�L� dS dS )+z0 Provides base classes for working with drivers � N) � TYPE_CHECKING�Any�Dict�List�Type�Tuple�Union�Callable�Optional)�get_size_price)�b)� BaseDriver� Connection� ConnectionKey)� SSHClient� BaseSSHClient�SSHCommandTimeoutError� have_paramiko)� LibcloudError)�Provider� NodeState�DeploymentError�StorageVolumeState�NodeImageMemberState)�is_private_subnet�is_valid_ip_address)� Deployment)�SSHException�AuthenticationException)�NodeAuthSSHKey�NodeAuthPassword�X �, )zno such file or directoryzinvalid keyznot a valid zinvalid or unsupported key typezprivate file is encryptedzprivate key file is encryptedz'private key file checkints do not matchzinvalid password provided)�Noder �NodeSize� NodeImage�NodeImageMember�NodeLocationr r � NodeDriver� StorageVolumer �VolumeSnapshotr r c @ s. e Zd ZdZd dd�Zdd� Zedd � �ZdS )� UuidMixinz, Mixin class for get_uuid function. �returnNc C s d | _ d S �N)�_uuid��self� r1 �I/opt/saltstack/salt/lib/python3.10/site-packages/libcloud/compute/base.py�__init__x s zUuidMixin.__init__c C s. | j st�td�| j| jj����� | _ | j S )aE Unique hash for a node, node image, or node size The hash is a function of an SHA1 hash of the node, node image, or node size's ID and its driver which means that it should be unique between all objects of its type. In some subclasses there is no ID available so the public IP address is used. This means that, unlike a properly done system UUID, the same UUID may mean a different system install at a different time >>> from libcloud.compute.drivers.dummy import DummyNodeDriver >>> driver = DummyNodeDriver(0) >>> node = driver.create_node() >>> node.get_uuid() 'd3748461511d8b9b0e0bfa0d4d3383a619a2bb9f' Note, for example, that this example will always produce the same UUID! :rtype: ``str`` z{}:{}) r. �hashlib�sha1r �format�id�driver�type� hexdigestr/ r1 r1 r2 �get_uuid{ s ��zUuidMixin.get_uuidc C s | � � S r- )r; r/ r1 r1 r2 �uuid� s zUuidMixin.uuid)r, N)�__name__� __module__�__qualname__�__doc__r3 r; �propertyr<