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:01:31 +0000 |
commit | 6e888ddeaf4b38c7ac90dab59d8beffbe84dfec8 (patch) | |
tree | 539211e083f3c2c8eeccc5c5f8745d2529273a0c /buildscripts | |
parent | c86c0d8ce815f8119d2483c6f744be6691aa1e6f (diff) | |
download | mongo-6e888ddeaf4b38c7ac90dab59d8beffbe84dfec8.tar.gz |
SERVER-59121 Check for ssh errors in all remote operation calls in powercycle
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 786d4cd409a..56f17b02950 100755 --- a/buildscripts/resmokelib/powercycle/powercycle.py +++ b/buildscripts/resmokelib/powercycle/powercycle.py @@ -566,6 +566,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 @@ -793,7 +795,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. @@ -946,10 +949,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: @@ -1541,7 +1544,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: |