diff --git a/common/ssh_client/base.py b/common/ssh_client/base.py index 16021e7c..81cb184a 100644 --- a/common/ssh_client/base.py +++ b/common/ssh_client/base.py @@ -30,6 +30,7 @@ def __init__(self, context, node): self.node = node self.ssh_type = node.get("ssh_type") or "remote" self.client = None + self.inner_config_manager = context.inner_config def exec_cmd(self, cmd): raise Exception("the client type is not support exec_cmd") @@ -53,6 +54,8 @@ def get_ip(self): return self.client.get_ip() def progress_bar(self, transferred, to_be_transferred, suffix=''): + if self.inner_config_manager.get("obdiag", default={"logger": {"silent": False}}).get("logger").get("silent"): + return bar_len = 20 filled_len = int(round(bar_len * transferred / float(to_be_transferred))) percents = round(20.0 * transferred / float(to_be_transferred), 1) diff --git a/common/ssh_client/remote_client.py b/common/ssh_client/remote_client.py index 4f1bb4b8..04717dc3 100644 --- a/common/ssh_client/remote_client.py +++ b/common/ssh_client/remote_client.py @@ -113,6 +113,8 @@ def download(self, remote_path, local_path): self._sftp_client.close() def progress_bar(self, transferred, to_be_transferred, suffix=''): + if self.inner_config_manager.get("obdiag", default={"logger": {"silent": False}}).get("logger").get("silent"): + return bar_len = 20 filled_len = int(round(bar_len * transferred / float(to_be_transferred))) percents = round(20.0 * transferred / float(to_be_transferred), 1)