Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gather all #344

Merged
merged 4 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/ssh_client/local_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def upload(self, remote_path, local_path):
try:
shutil.copy(local_path, remote_path)
except Exception as e:
self.stdio.error("upload file to localhost, remote _path =[{0}], local _path=[{1}], error=[{2}]".format(remote_path, local_path, str(e)))
self.stdio.error("upload file to localhost, remote_path =[{0}], local_path=[{1}], error=[{2}]".format(remote_path, local_path, str(e)))
raise Exception("[local] upload file to localhost, remote _path =[{0}], local _path=[{1}], error=[{2}]".format(remote_path, local_path, str(e)))

def ssh_invoke_shell_switch_user(self, new_user, cmd, time_out):
Expand Down
2 changes: 1 addition & 1 deletion common/ssh_client/remote_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def progress_bar(self, transferred, to_be_transferred, suffix=''):
def upload(self, remote_path, local_path):
transport = self._ssh_fd.get_transport()
self._sftp_client = paramiko.SFTPClient.from_transport(transport)
self._sftp_client.put(remote_path, local_path)
self._sftp_client.put(local_path, remote_path)
self._sftp_client.close()

def ssh_invoke_shell_switch_user(self, new_user, cmd, time_out):
Expand Down
2 changes: 1 addition & 1 deletion handler/gather/gather_obproxy_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def __pharse_log(self, ssh_client, home_path, log_name, gather_path):
grep_cmd = "grep -e '{0}' ".format(grep_arg) + "{log_dir}/{log_name}".format(log_name=log_name, log_dir=log_path)
continue
grep_cmd += "| grep -e '{0}'".format(grep_arg)
grep_cmd += " >> {log_dir}/{log_name}".format(log_name=log_name, log_dir=log_path)
grep_cmd += " >> {gather_path}/{log_name}".format(log_name=log_name, gather_path=gather_path)
self.stdio.verbose("grep files, run cmd = [{0}]".format(grep_cmd))
ssh_client.exec_cmd(grep_cmd)
else:
Expand Down
Loading