(self, parsed_args, parsed_globals)
| 112 | ] |
| 113 | |
| 114 | def _run_main_command(self, parsed_args, parsed_globals): |
| 115 | try: |
| 116 | master_dns = sshutils.validate_and_find_master_dns( |
| 117 | session=self._session, |
| 118 | parsed_globals=parsed_globals, |
| 119 | cluster_id=parsed_args.cluster_id, |
| 120 | ) |
| 121 | |
| 122 | key_file = parsed_args.key_pair_file |
| 123 | sshutils.validate_ssh_with_key_file(key_file) |
| 124 | f = tempfile.NamedTemporaryFile(delete=False) |
| 125 | if emrutils.which('ssh') or emrutils.which('ssh.exe'): |
| 126 | ssh_options = _build_ssh_options(parsed_args.ssh_options) |
| 127 | command = ['ssh'] + ssh_options + [ |
| 128 | '-o', 'ServerAliveInterval=10', |
| 129 | '-ND', '8157', |
| 130 | '-i', parsed_args.key_pair_file, |
| 131 | constants.SSH_USER + '@' + master_dns, |
| 132 | ] |
| 133 | else: |
| 134 | if parsed_args.ssh_options: |
| 135 | sys.stderr.write(PUTTY_SSH_OPTIONS_MSG) |
| 136 | command = [ |
| 137 | 'putty', '-ssh', '-i', parsed_args.key_pair_file, |
| 138 | constants.SSH_USER + '@' + master_dns, |
| 139 | '-N', '-D', '8157', |
| 140 | ] |
| 141 | |
| 142 | print(' '.join(command)) |
| 143 | rc = subprocess.call(command) |
| 144 | return rc |
| 145 | except KeyboardInterrupt: |
| 146 | print('Disabling Socks Tunnel.') |
| 147 | return 0 |
| 148 | |
| 149 | |
| 150 | class SSH(Command): |
nothing calls this directly
no test coverage detected