From 2d4fffc6b0505ed017d958ca096c74857d052d93 Mon Sep 17 00:00:00 2001 From: James Mason Date: Fri, 29 Jul 2022 10:28:58 -0700 Subject: [PATCH 1/2] Use timeout argument for all paramiko timeout options --- lib/ec2imgutils/ec2uploadimg.py | 4 +++- python3-ec2imgutils.spec | 4 +--- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ec2imgutils/ec2uploadimg.py b/lib/ec2imgutils/ec2uploadimg.py index f0b89cf..0eb664e 100644 --- a/lib/ec2imgutils/ec2uploadimg.py +++ b/lib/ec2imgutils/ec2uploadimg.py @@ -604,7 +604,9 @@ def _establish_ssh_connection(self): key_filename=self.ssh_key_private_key_file, username=self.inst_user_name, hostname=instance_ip, - timeout=10 + timeout=self.ssh_timeout, + banner_timeout=self.ssh_timeout, + auth_timeout=self.ssh_timeout ) except (Exception, ConnectionResetError): if self.log_level == logging.DEBUG: diff --git a/python3-ec2imgutils.spec b/python3-ec2imgutils.spec index cbb2a47..63dae12 100644 --- a/python3-ec2imgutils.spec +++ b/python3-ec2imgutils.spec @@ -29,7 +29,7 @@ Source0: %{upstream_name}-%{version}.tar.bz2 Requires: python3 Requires: python3-boto3 >= 1.29.84 Requires: python3-dateutil -Requires: python3-paramiko +Requires: python3-paramiko >= 2.2.0 BuildRequires: python3-boto3 >= 1.29.84 BuildRequires: python3-dateutil BuildRequires: python3-setuptools @@ -87,5 +87,3 @@ gzip %{buildroot}/%{_mandir}/man1/* %{_bindir}/* %changelog - - diff --git a/requirements.txt b/requirements.txt index 1ee2e8a..a890108 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ boto3>=1.4.1 -paramiko +paramiko>=2.2.0 python-dateutil From 864f375d7ac1e27f53c8fcd136bfdc66b4f295a2 Mon Sep 17 00:00:00 2001 From: Sean Marlow Date: Wed, 24 Jan 2024 14:22:12 -0500 Subject: [PATCH 2/2] Fix unit test Add new timeouts to expected call args --- tests/test_libec2uploadimg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_libec2uploadimg.py b/tests/test_libec2uploadimg.py index 7b18b06..6080fc6 100644 --- a/tests/test_libec2uploadimg.py +++ b/tests/test_libec2uploadimg.py @@ -1486,7 +1486,9 @@ def test_establish_ssh_connection( key_filename=None, username=None, hostname='1.2.3.4', - timeout=10 + timeout=300, + banner_timeout=300, + auth_timeout=300 ), ])