summaryrefslogtreecommitdiff
path: root/buildscripts/remote_operations.py
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@Jonathans-MacBook-Pro.local>2018-09-13 10:30:39 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-09-20 16:52:16 -0400
commitc5c89977a194e4b5ee7c708c64fdd9d6a5a736c2 (patch)
treecf214c84ebb6580afb07e19a7bc66dea913bfc31 /buildscripts/remote_operations.py
parent39ccfc54ed857806dfeac759f586d8c734d40acd (diff)
downloadmongo-c5c89977a194e4b5ee7c708c64fdd9d6a5a736c2.tar.gz
SERVER-36162 Powercycle - ensure internal crash command has been executed on the remote host
(cherry picked from commit f4d62c2ba9a27dc03663779d0817bc399ab2e91f)
Diffstat (limited to 'buildscripts/remote_operations.py')
-rwxr-xr-xbuildscripts/remote_operations.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/buildscripts/remote_operations.py b/buildscripts/remote_operations.py
index a1f95f117e8..93798ae7ac1 100755
--- a/buildscripts/remote_operations.py
+++ b/buildscripts/remote_operations.py
@@ -35,6 +35,7 @@ _OPERATIONS = ["shell", "copy_to", "copy_from"]
_SSH_CONNECTION_ERRORS = [
"Connection refused",
+ "Connection timed out during banner exchange",
"Permission denied",
"System is booting up.",
"ssh_exchange_identification: read: Connection reset by peer",
@@ -110,13 +111,22 @@ class RemoteOperations(object): # pylint: disable=too-many-instance-attributes
return self._call(cmd)
def access_established(self):
- """Return True if initial access was establsished."""
+ """Return True if initial access was established."""
return not self._access_code
def access_info(self):
"""Return the return code and output buffer from initial access attempt(s)."""
return self._access_code, self._access_buff
+ @staticmethod
+ def ssh_error(message):
+ """Return True if the error message is generated from the ssh client.
+
+ This can help determine if an error is due to a remote operation failing or an ssh
+ related issue, like a connection issue.
+ """
+ return message.startswith("ssh:")
+
def operation( # pylint: disable=too-many-branches
self, operation_type, operation_param, operation_dir=None):
"""Execute Main entry for remote operations. Returns (code, output).