HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/emr/__pycache__/ssh.cpython-310.pyc
o

.&�a3�@s�ddlZddlZddlZddlmZddlmZddlmZddlmZdZ	Gdd�de�Z
Gd	d
�d
e�ZGdd�de�ZGd
d�de�Z
dS)�N)�	constants)�emrutils)�sshutils)�Commandz�
A value for the variable Key Pair File can be set in the AWS CLI config file using the "aws configure set emr.key_pair_file <value>" command.
c@s8eZdZdZdeZdddd�dddd�gZd	d
�ZdS)�Socks�sockszFCreate a socks tunnel on port 8157 from your machine to the master.
%s�
cluster-idT�*Cluster Id of cluster you want to ssh into��name�required�	help_text�
key-pair-file�!Private key file to use for logincCs�zTtj|j||jd�}|j}t�|�tjdd�}t�	d�s#t�	d�r6dddddd	d
d|jt
jd|g
}nd
dd|jt
jd|ddd
g}td�
|��t�|�}|WStybtd�YdSw)N��session�parsed_globals�
cluster_idF��delete�ssh�ssh.exe�-o�StrictHostKeyChecking=no�ServerAliveInterval=10z-ND�8157�-i�@�putty�-sshz-Nz-D� zDisabling Socks Tunnel.r)r�validate_and_find_master_dns�_sessionr�
key_pair_file�validate_ssh_with_key_file�tempfile�NamedTemporaryFiler�whichr�SSH_USER�print�join�
subprocess�call�KeyboardInterrupt��self�parsed_argsr�
master_dns�key_file�f�command�rc�r6�?/usr/lib/python3/dist-packages/awscli/customizations/emr/ssh.py�_run_main_command's:�
���
�
�zSocks._run_main_commandN��__name__�
__module__�__qualname__�NAME�KEY_PAIR_FILE_HELP_TEXT�DESCRIPTION�	ARG_TABLEr8r6r6r6r7rs����rc@s@eZdZdZdeZdddd�dddd�d	d
d�gZdd
�ZdS)�SSHrz'SSH into master node of the cluster.
%srTr	r
rrr4z!Command to execute on Master Node�rr
c	Cs�tj|j||jd�}|j}t�|�tjdd�}t�	d�s"t�	d�r=dddddd	|jt
jd
|dg	}|jr<|�
|j�n'dd
d	|jt
jd
|dg}|jrd|�|j�|�d�|�
d�|�
|j�|��td�|��t�|�}t�|j�|S)NrFrrrrrrrrz-trrz3
read -n1 -r -p "Command completed. Press any key."z-mr )rr!r"rr#r$r%r&rr'rr(r4�append�writer�closer)r*r+r,�os�remover.r6r6r7r8OsD�
����
�


zSSH._run_main_commandNr9r6r6r6r7rACs����rAc@�JeZdZdZdeZdddd�dddd�d	dd
d�ddd
�gZdd�ZdS)�Put�putz!Put file onto the master node.
%srTz/Cluster Id of cluster you want to put file ontor
rr�srcz!Source file path on local machine�destz$Destination file path on remote hostrBcCs�tj|j||jd�}|j}t�|�t�d�st�d�r-dddd|j|jt	j
d|g}ndd	dd|j|jt	j
d|g}|jrL|d
d|j|d
<n|d
d|j�d�d
|d
<t
d
�|��t�|�}|S)Nr�scp�scp.exe�-r�-o StrictHostKeyChecking=norr�pscp�-scp����:�/r )rr!r"rr#�validate_scp_with_key_filerr'rKrr(rL�splitr)r*r+r,�r/r0rr1r2r4r5r6r6r7r8}s*�

�� 
zPut._run_main_commandNr9r6r6r6r7rIos"�����
rIc@rH)�Get�getzGet file from master node.
%srTz/Cluster Id of cluster you want to get file fromr
rrrKzSource file path on remote hostrLz%Destination file path on your machinerBcCs�tj|j||jd�}|j}t�|�t�d�st�d�r0dddd|jtj	d|d|j
g}nd	d
dd|jtj	d|d|j
g}|jrM|�|j�n|�|j
�
d�d�td
�|��t�|�}|S)NrrMrNrOrPrrrTrQrRrUrSr )rr!r"rr#rVrr'rr(rKrLrCrWr)r*r+r,rXr6r6r7r8�s8�
������
zGet._run_main_commandNr9r6r6r6r7rY�s����
rY)rFr+r%�awscli.customizations.emrrrr�!awscli.customizations.emr.commandrr>rrArIrYr6r6r6r7�<module>s
',(