Hello community,

here is the log from the commit of package python-testinfra for 
openSUSE:Factory checked in at 2019-06-03 18:57:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-testinfra (Old)
 and      /work/SRC/openSUSE:Factory/.python-testinfra.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-testinfra"

Mon Jun  3 18:57:49 2019 rev:7 rq:707116 version:3.0.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-testinfra/python-testinfra.changes        
2019-05-27 08:38:38.755064881 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-testinfra.new.5148/python-testinfra.changes  
    2019-06-03 18:57:49.760374130 +0200
@@ -1,0 +2,7 @@
+Mon Jun  3 10:06:46 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 3.0.5:
+  * Set default timeout to 10s on ssh/paramiko connections
+  * Add support for ansible inventory parameter ansible_private_key_file
+
+-------------------------------------------------------------------

Old:
----
  testinfra-3.0.4.tar.gz

New:
----
  testinfra-3.0.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-testinfra.spec ++++++
--- /var/tmp/diff_new_pack.ZOBAy5/_old  2019-06-03 18:57:50.776373753 +0200
+++ /var/tmp/diff_new_pack.ZOBAy5/_new  2019-06-03 18:57:50.780373752 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-testinfra
-Version:        3.0.4
+Version:        3.0.5
 Release:        0
 Summary:        Test infrastructures
 License:        Apache-2.0

++++++ testinfra-3.0.4.tar.gz -> testinfra-3.0.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testinfra-3.0.4/CHANGELOG.rst 
new/testinfra-3.0.5/CHANGELOG.rst
--- old/testinfra-3.0.4/CHANGELOG.rst   2019-05-18 15:40:43.000000000 +0200
+++ new/testinfra-3.0.5/CHANGELOG.rst   2019-05-29 23:43:03.000000000 +0200
@@ -2,6 +2,12 @@
 Changelog
 =========
 
+3.0.5
+=====
+
+* Set default timeout to 10s on ssh/paramiko connections
+* Add support for ansible inventory parameter ansible_private_key_file
+
 3.0.4
 =====
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testinfra-3.0.4/PKG-INFO new/testinfra-3.0.5/PKG-INFO
--- old/testinfra-3.0.4/PKG-INFO        2019-05-18 15:41:22.000000000 +0200
+++ new/testinfra-3.0.5/PKG-INFO        2019-05-29 23:44:05.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: testinfra
-Version: 3.0.4
+Version: 3.0.5
 Summary: Test infrastructures
 Home-page: https://github.com/philpep/testinfra
 Author: Philippe Pepiot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testinfra-3.0.4/test/test_backends.py 
new/testinfra-3.0.5/test/test_backends.py
--- old/testinfra-3.0.4/test/test_backends.py   2019-05-09 23:53:28.000000000 
+0200
+++ new/testinfra-3.0.5/test/test_backends.py   2019-05-29 22:00:55.000000000 
+0200
@@ -161,6 +161,14 @@
         'host.port': '2222',
         'ssh_identity_file': 'key',
     }),
+    ('host', {}, b'host ansible_host=127.0.1.1 ansible_user=u 
ansible_private_key_file=key ansible_port=2222 ansible_become=yes 
ansible_become_user=u', {  # noqa
+        'NAME': 'paramiko',
+        'sudo': True,
+        'sudo_user': 'u',
+        'host.name': '127.0.1.1',
+        'host.port': '2222',
+        'ssh_identity_file': 'key',
+    }),
     ('host', {}, b'host ansible_connection=docker', {
         'NAME': 'docker',
         'name': 'host',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testinfra-3.0.4/testinfra/backend/__init__.py 
new/testinfra-3.0.5/testinfra/backend/__init__.py
--- old/testinfra-3.0.4/testinfra/backend/__init__.py   2019-05-18 
14:13:41.000000000 +0200
+++ new/testinfra-3.0.5/testinfra/backend/__init__.py   2019-05-29 
23:41:33.000000000 +0200
@@ -52,7 +52,7 @@
             if query.get(key, ['false'])[0].lower() == 'true':
                 kw[key] = True
         for key in ("sudo_user", 'namespace', 'container', 'read_timeout_sec',
-                    'operation_timeout_sec'):
+                    'operation_timeout_sec', 'timeout'):
             if key in query:
                 kw[key] = query.get(key)[0]
         for key in (
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testinfra-3.0.4/testinfra/backend/paramiko.py 
new/testinfra-3.0.5/testinfra/backend/paramiko.py
--- old/testinfra-3.0.4/testinfra/backend/paramiko.py   2019-05-09 
22:56:12.000000000 +0200
+++ new/testinfra-3.0.5/testinfra/backend/paramiko.py   2019-05-29 
23:41:33.000000000 +0200
@@ -40,11 +40,12 @@
 
     def __init__(
             self, hostspec, ssh_config=None, ssh_identity_file=None,
-            *args, **kwargs):
+            timeout=10, *args, **kwargs):
         self.host = self.parse_hostspec(hostspec)
         self.ssh_config = ssh_config
         self.ssh_identity_file = ssh_identity_file
         self.get_pty = False
+        self.timeout = int(timeout)
         super(ParamikoBackend, self).__init__(self.host.name, *args, **kwargs)
 
     def _load_ssh_config(self, client, cfg, ssh_config):
@@ -74,6 +75,7 @@
             "hostname": self.host.name,
             "port": int(self.host.port) if self.host.port else 22,
             "username": self.host.user,
+            "timeout": self.timeout,
         }
         if self.ssh_config:
             with open(self.ssh_config) as f:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testinfra-3.0.4/testinfra/backend/ssh.py 
new/testinfra-3.0.5/testinfra/backend/ssh.py
--- old/testinfra-3.0.4/testinfra/backend/ssh.py        2019-04-30 
00:34:57.000000000 +0200
+++ new/testinfra-3.0.5/testinfra/backend/ssh.py        2019-05-29 
23:41:33.000000000 +0200
@@ -23,10 +23,11 @@
     NAME = "ssh"
 
     def __init__(self, hostspec, ssh_config=None, ssh_identity_file=None,
-                 *args, **kwargs):
+                 timeout=10, *args, **kwargs):
         self.host = self.parse_hostspec(hostspec)
         self.ssh_config = ssh_config
         self.ssh_identity_file = ssh_identity_file
+        self.timeout = int(timeout)
         super(SshBackend, self).__init__(self.host.name, *args, **kwargs)
 
     def run(self, command, *args, **kwargs):
@@ -47,11 +48,16 @@
         if self.ssh_identity_file:
             cmd.append("-i %s")
             cmd_args.append(self.ssh_identity_file)
+        cmd.append("-o ConnectTimeout={}".format(self.timeout))
         cmd.append("%s %s")
         cmd_args.extend([self.host.name, command])
         out = self.run_local(
             " ".join(cmd), *cmd_args)
         out.command = self.encode(command)
+        if out.rc == 255:
+            # ssh exits with the exit status of the remote command or with 255
+            # if an error occurred.
+            raise RuntimeError(out)
         return out
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testinfra-3.0.4/testinfra/utils/ansible_runner.py 
new/testinfra-3.0.5/testinfra/utils/ansible_runner.py
--- old/testinfra-3.0.4/testinfra/utils/ansible_runner.py       2019-05-18 
15:38:58.000000000 +0200
+++ new/testinfra-3.0.5/testinfra/utils/ansible_runner.py       2019-05-29 
21:47:14.000000000 +0200
@@ -82,9 +82,15 @@
         kwargs['ssh_config'] = ssh_config
     if ssh_identity_file is not None:
         kwargs['ssh_identity_file'] = ssh_identity_file
+
+    # Support both keys as advertised by Ansible
     if 'ansible_ssh_private_key_file' in hostvars:
         kwargs['ssh_identity_file'] = hostvars[
             'ansible_ssh_private_key_file']
+    elif 'ansible_private_key_file' in hostvars:
+        kwargs['ssh_identity_file'] = hostvars[
+            'ansible_private_key_file']
+
     spec = '{}://'.format(connection)
     if user:
         spec += '{}@'.format(user)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testinfra-3.0.4/testinfra.egg-info/PKG-INFO 
new/testinfra-3.0.5/testinfra.egg-info/PKG-INFO
--- old/testinfra-3.0.4/testinfra.egg-info/PKG-INFO     2019-05-18 
15:41:22.000000000 +0200
+++ new/testinfra-3.0.5/testinfra.egg-info/PKG-INFO     2019-05-29 
23:44:05.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: testinfra
-Version: 3.0.4
+Version: 3.0.5
 Summary: Test infrastructures
 Home-page: https://github.com/philpep/testinfra
 Author: Philippe Pepiot


Reply via email to