File: //lib/python3/dist-packages/awscli/customizations/emr/__pycache__/ssh.cpython-310.pyc
o
.&�a3 � @ s� d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ dZ G dd� de�Z
G d d
� d
e�ZG dd� de�ZG d
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 @ s8 e Zd ZdZde Zdddd�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 loginc C s� zTt j| j||jd�}|j}t �|� tjdd�}t� d�s#t� d�r6dddddd d
d|jt
jd | g
}nd
dd|jt
jd | ddd
g}td�
|�� t�|�}|W S tyb td� Y dS w )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'