Skip to content

Commit

Permalink
Collectinfo regression (#189)
Browse files Browse the repository at this point in the history
* fix: Role or privilege violation causing further requests to not execute

* fix: Don't mark node as dead when ssh connection error occurs
  • Loading branch information
Jesse S authored Aug 25, 2023
1 parent fcabc6e commit ce5e393
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
11 changes: 0 additions & 11 deletions lib/live_cluster/client/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,6 @@ async def info_peers_flat_list(self):
###### Service ######
# post 3.10 services

# @return_exceptions
def _info_service_helper(self, service, delimiter=","):
if not service or isinstance(service, Exception):
return []
Expand Down Expand Up @@ -3271,7 +3270,6 @@ def _set_system_credentials(self):
self.sys_ssh_key = self.sys_default_ssh_key
self.sys_ssh_port = self.sys_default_ssh_port

@return_exceptions
def _get_localhost_system_statistics(self, commands):
sys_stats = {}

Expand Down Expand Up @@ -3304,15 +3302,13 @@ def _get_localhost_system_statistics(self, commands):

return sys_stats

@return_exceptions
def _login_remote_system(self, ip, user, pwd, ssh_key=None, port=None):
s = pxssh.pxssh()
s.force_password = True
s.SSH_OPTS = "-o 'NumberOfPasswordPrompts=1'"
s.login(ip, user, pwd, ssh_key=ssh_key, port=port)
return s

@return_exceptions
def _create_ssh_connection(self, ip, user, pwd, ssh_key=None, port=None):
if user is None and pwd is None and ssh_key is None:
raise Exception("Insufficient credentials to connect.")
Expand All @@ -3322,7 +3318,6 @@ def _create_ssh_connection(self, ip, user, pwd, ssh_key=None, port=None):

return None

@return_exceptions
def _execute_remote_system_command(self, conn, cmd):
if not conn or not cmd or PEXPECT_VERSION == PXSSH_NO_MODULE:
return None
Expand All @@ -3334,7 +3329,6 @@ def _execute_remote_system_command(self, conn, cmd):
return None
return conn.before

@return_exceptions
def _execute_system_command(self, conn, cmd):
out = self._execute_remote_system_command(conn, cmd)
status = self._execute_remote_system_command(conn, "echo $?")
Expand All @@ -3347,7 +3341,6 @@ def _execute_system_command(self, conn, cmd):

return status, out

@return_exceptions
def _stop_ssh_connection(self, conn):
if not conn or PEXPECT_VERSION == PXSSH_NO_MODULE:
return
Expand All @@ -3359,7 +3352,6 @@ def _stop_ssh_connection(self, conn):

self.remote_system_command_prompt = "[#$] "

@return_exceptions
def _get_remote_host_system_statistics(self, commands):
sys_stats = {}

Expand Down Expand Up @@ -3390,9 +3382,6 @@ def _get_remote_host_system_statistics(self, commands):
if not s:
raise Exception("Wrong credentials to connect.")

if isinstance(s, Exception):
raise s

except Exception as e:
if tries >= max_tries:
self.logger.warning(
Expand Down
1 change: 0 additions & 1 deletion lib/live_cluster/client/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def create_exc(as_response, message):
ASResponse.EXPIRED_PASSWORD,
ASResponse.NO_CREDENTIAL_OR_BAD_CREDENTIAL,
ASResponse.NOT_AUTHENTICATED,
ASResponse.ROLE_OR_PRIVILEGE_VIOLATION,
ASResponse.NOT_WHITELISTED,
ASResponse.EXPIRED_SESSION,
}:
Expand Down

0 comments on commit ce5e393

Please sign in to comment.