Fix imports

Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
Katarzyna Treder
2024-12-13 15:18:42 +01:00
parent fd869a0afc
commit 5bd6a656c5
37 changed files with 170 additions and 231 deletions

View File

@@ -3,13 +3,14 @@
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
import os
import re
import paramiko
import socket
import subprocess
from datetime import timedelta, datetime
import paramiko
from datetime import timedelta, datetime
from connection.base_executor import BaseExecutor
from core.test_run import TestRun, Blocked
@@ -46,7 +47,7 @@ class SshExecutor(BaseExecutor):
hostname = target["hostname"]
key_filename = target.get("identityfile", None)
user = target.get("user", user)
port = target.get("port", port)
port = int(target.get("port", port))
if target.get("proxyjump", None) is not None:
proxy = config.lookup(target["proxyjump"])
jump = paramiko.SSHClient()

View File

@@ -0,0 +1,4 @@
#
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

View File

@@ -1,9 +1,10 @@
#
# Copyright(c) 2020-2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
import concurrent
from concurrent.futures import ThreadPoolExecutor
def start_async_func(func, *args):
@@ -14,5 +15,5 @@ def start_async_func(func, *args):
- done() method returns True when task ended (have a result or ended with an exception)
otherwise returns False
"""
executor = concurrent.futures.ThreadPoolExecutor()
executor = ThreadPoolExecutor()
return executor.submit(func, *args)

View File

@@ -1,5 +1,6 @@
#
# Copyright(c) 2019-2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

View File

@@ -1,5 +1,6 @@
#
# Copyright(c) 2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -33,7 +34,7 @@ class Retry:
try:
result = func()
return True
except:
except Exception:
return False
cls.run_while_false(wrapped_func, retries=retries, timeout=timeout)