From b7900cdb439e8f1de37931f6c3e52a82d26ea173 Mon Sep 17 00:00:00 2001 From: zuohanxu Date: Thu, 20 Jul 2023 17:33:45 +0800 Subject: [PATCH] Modify static check Signed-off-by: zuohanxu --- avocado/utils/ssh.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/avocado/utils/ssh.py b/avocado/utils/ssh.py index cfcc2addad..74b7bf4476 100644 --- a/avocado/utils/ssh.py +++ b/avocado/utils/ssh.py @@ -223,11 +223,11 @@ def cmd(self, command, ignore_status=True, timeout=None): :returns: The command result object. :rtype: A :class:`avocado.utils.process.CmdResult` instance. """ + if timeout: + command_argument = f"timeout --foreground {timeout} {command}" + else: + command_argument = command try: - if timeout: - command_argument = f"timeout --foreground {timeout} {command}" - else: - command_argument = command return process.run( self.get_raw_ssh_command(command_argument), ignore_status=ignore_status )