diff options
author | Mikhail Shchatko <mikhail.shchatko@mongodb.com> | 2021-08-06 12:42:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-08-09 08:36:39 +0000 |
commit | 9826d642c98e2ef28b3fa29e1e6fa4bbe66cfd38 (patch) | |
tree | b6bff5241edc2b11ba85db20b69f13ac937991bc /buildscripts | |
parent | 0cf4776112bb288f3606c0e99c01595b202a826e (diff) | |
download | mongo-9826d642c98e2ef28b3fa29e1e6fa4bbe66cfd38.tar.gz |
SERVER-59121 Check for ssh errors in all remote operation calls in powercycle
(cherry picked from commit 6e888ddeaf4b38c7ac90dab59d8beffbe84dfec8)
Diffstat (limited to 'buildscripts')
-rwxr-xr-x | buildscripts/resmokelib/powercycle/powercycle.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/buildscripts/resmokelib/powercycle/powercycle.py b/buildscripts/resmokelib/powercycle/powercycle.py index c493ac7c22a..5c0c4cc0cfd 100755 --- a/buildscripts/resmokelib/powercycle/powercycle.py +++ b/buildscripts/resmokelib/powercycle/powercycle.py @@ -565,6 +565,8 @@ def call_remote_operation(local_ops, remote_python, script_name, client_args, op """Call the remote operation and return tuple (ret, ouput).""" client_call = f"{remote_python} {script_name} {client_args} {operation}" ret, output = local_ops.shell(client_call) + if local_ops.ssh_error(output): + ssh_failure_exit(ret, output) return ret, output @@ -792,7 +794,8 @@ def remote_handler(options, task_config, root_dir): # Perform the sequence of operations specified. If any operation fails then return immediately. for operation in options.remote_operations: ret = 0 - if operation == "noop": + + def noop(): pass # This is the internal "crash" mechanism, which is executed on the remote host. @@ -945,10 +948,10 @@ def remote_handler(options, task_config, root_dir): return ret op_map = { - "crash_server": crash_server, "kill_mongod": kill_mongod, "install_mongod": - install_mongod, "start_mongod": start_mongod, "stop_mongod": stop_mongod, - "shutdown_mongod": shutdown_mongod, "rsync_data": rsync_data, "seed_docs": seed_docs, - "set_fcv": set_fcv, "check_disk": check_disk + "noop": noop, "crash_server": crash_server, "kill_mongod": kill_mongod, + "install_mongod": install_mongod, "start_mongod": start_mongod, "stop_mongod": + stop_mongod, "shutdown_mongod": shutdown_mongod, "rsync_data": rsync_data, + "seed_docs": seed_docs, "set_fcv": set_fcv, "check_disk": check_disk } if operation not in op_map: @@ -1540,7 +1543,6 @@ def main(parser_actions, options): # pylint: disable=too-many-branches,too-many setup_ssh_tunnel(mongod_host, secret_port, standard_port, ssh_connection_options, ssh_options, ssh_user_host) - verify_remote_access(local_ops) # Optionally validate canary document locally. if validate_canary_local: |