(self, parsed_args, parsed_globals)
| 172 | ] |
| 173 | |
| 174 | def _run_main_command(self, parsed_args, parsed_globals): |
| 175 | master_dns = sshutils.validate_and_find_master_dns( |
| 176 | session=self._session, |
| 177 | parsed_globals=parsed_globals, |
| 178 | cluster_id=parsed_args.cluster_id, |
| 179 | ) |
| 180 | |
| 181 | key_file = parsed_args.key_pair_file |
| 182 | sshutils.validate_ssh_with_key_file(key_file) |
| 183 | f = tempfile.NamedTemporaryFile(delete=False) |
| 184 | if emrutils.which('ssh') or emrutils.which('ssh.exe'): |
| 185 | ssh_options = _build_ssh_options(parsed_args.ssh_options) |
| 186 | command = ['ssh'] + ssh_options + [ |
| 187 | '-o', 'ServerAliveInterval=10', |
| 188 | '-i', parsed_args.key_pair_file, |
| 189 | constants.SSH_USER + '@' + master_dns, |
| 190 | '-t', |
| 191 | ] |
| 192 | if parsed_args.command: |
| 193 | command.append(parsed_args.command) |
| 194 | else: |
| 195 | if parsed_args.ssh_options: |
| 196 | sys.stderr.write(PUTTY_SSH_OPTIONS_MSG) |
| 197 | command = [ |
| 198 | 'putty', '-ssh', '-i', parsed_args.key_pair_file, |
| 199 | constants.SSH_USER + '@' + master_dns, '-t', |
| 200 | ] |
| 201 | if parsed_args.command: |
| 202 | f.write(parsed_args.command) |
| 203 | f.write('\nread -n1 -r -p "Command completed. Press any key."') |
| 204 | command.append('-m') |
| 205 | command.append(f.name) |
| 206 | |
| 207 | f.close() |
| 208 | print(' '.join(command)) |
| 209 | rc = subprocess.call(command) |
| 210 | os.remove(f.name) |
| 211 | return rc |
| 212 | |
| 213 | |
| 214 | class Put(Command): |
nothing calls this directly
no test coverage detected