Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pytest-testinfra for 
openSUSE:Factory checked in at 2024-06-07 15:04:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-testinfra (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-testinfra.new.24587 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-testinfra"

Fri Jun  7 15:04:47 2024 rev:7 rq:1179143 version:10.1.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-pytest-testinfra/python-pytest-testinfra.changes
  2024-03-17 22:15:30.595300508 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-testinfra.new.24587/python-pytest-testinfra.changes
       2024-06-07 15:05:46.945052846 +0200
@@ -1,0 +2,10 @@
+Fri Jun  7 07:02:49 UTC 2024 - Dirk Müller <dmuel...@suse.com>
+
+- update to 10.1.1:
+  * [FIX] Add check for the existence of ssh control path
+    directory
+  * [FIX] Handle is_installed for rpm package when rpm database
+    is corrupted
+  * [FIX] Fix service.exists
+
+-------------------------------------------------------------------

Old:
----
  pytest-testinfra-10.1.0.tar.gz

New:
----
  pytest-testinfra-10.1.1.tar.gz

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

Other differences:
------------------
++++++ python-pytest-testinfra.spec ++++++
--- /var/tmp/diff_new_pack.6ntiLX/_old  2024-06-07 15:05:47.397069312 +0200
+++ /var/tmp/diff_new_pack.6ntiLX/_new  2024-06-07 15:05:47.397069312 +0200
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-pytest-testinfra
-Version:        10.1.0
+Version:        10.1.1
 Release:        0
 Summary:        Python module to test infrastructures
 License:        Apache-2.0

++++++ pytest-testinfra-10.1.0.tar.gz -> pytest-testinfra-10.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-testinfra-10.1.0/CHANGELOG.rst 
new/pytest-testinfra-10.1.1/CHANGELOG.rst
--- old/pytest-testinfra-10.1.0/CHANGELOG.rst   2024-02-15 06:02:21.000000000 
+0100
+++ new/pytest-testinfra-10.1.1/CHANGELOG.rst   2024-05-26 18:28:54.000000000 
+0200
@@ -2,6 +2,13 @@
 Changelog
 =========
 
+10.1.1
+======
+
+* [FIX] Add check for the existence of ssh control path directory
+* [FIX] Handle is_installed for rpm package when rpm database is corrupted
+* [FIX] Fix service.exists
+
 10.1.0
 ======
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-testinfra-10.1.0/PKG-INFO 
new/pytest-testinfra-10.1.1/PKG-INFO
--- old/pytest-testinfra-10.1.0/PKG-INFO        2024-02-15 06:02:35.177928700 
+0100
+++ new/pytest-testinfra-10.1.1/PKG-INFO        2024-05-26 18:48:26.822989700 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pytest-testinfra
-Version: 10.1.0
+Version: 10.1.1
 Summary: Test infrastructures
 Home-page: https://github.com/pytest-dev/pytest-testinfra
 Author: Philippe Pepiot
@@ -23,20 +23,15 @@
 Classifier: Framework :: Pytest
 Requires-Python: >=3.9
 Description-Content-Type: text/x-rst
-License-File: LICENSE
-Requires-Dist: pytest>=6
 Provides-Extra: ansible
-Requires-Dist: ansible; extra == "ansible"
 Provides-Extra: docker
 Provides-Extra: kubectl
 Provides-Extra: local
 Provides-Extra: lxc
 Provides-Extra: paramiko
-Requires-Dist: paramiko; extra == "paramiko"
 Provides-Extra: salt
-Requires-Dist: salt; extra == "salt"
 Provides-Extra: winrm
-Requires-Dist: pywinrm; extra == "winrm"
+License-File: LICENSE
 
 ##################################
 Testinfra test your infrastructure
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pytest-testinfra-10.1.0/images/debian_bookworm/Dockerfile 
new/pytest-testinfra-10.1.1/images/debian_bookworm/Dockerfile
--- old/pytest-testinfra-10.1.0/images/debian_bookworm/Dockerfile       
2024-02-15 06:02:21.000000000 +0100
+++ new/pytest-testinfra-10.1.1/images/debian_bookworm/Dockerfile       
2024-05-26 17:58:19.000000000 +0200
@@ -66,7 +66,12 @@
 RUN /v/bin/pip install 'requests==2.30.0'
 
 # install salt
-RUN python3 -m pip install --break-system-packages --no-cache salt
+ARG _BUILD_DEPS="gcc g++ libc6-dev python3-dev"
+RUN apt update && apt install -y $_BUILD_DEPS && \
+    python3 -m pip install --break-system-packages --no-cache salt && \
+    apt -y purge $_BUILD_DEPS && \
+    apt -y autoremove --purge && \
+    rm -rf /var/lib/apt/lists/*
 
 ENV LANG fr_FR.ISO-8859-15
 ENV LANGUAGE fr_FR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pytest-testinfra-10.1.0/pytest_testinfra.egg-info/PKG-INFO 
new/pytest-testinfra-10.1.1/pytest_testinfra.egg-info/PKG-INFO
--- old/pytest-testinfra-10.1.0/pytest_testinfra.egg-info/PKG-INFO      
2024-02-15 06:02:35.000000000 +0100
+++ new/pytest-testinfra-10.1.1/pytest_testinfra.egg-info/PKG-INFO      
2024-05-26 18:48:26.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pytest-testinfra
-Version: 10.1.0
+Version: 10.1.1
 Summary: Test infrastructures
 Home-page: https://github.com/pytest-dev/pytest-testinfra
 Author: Philippe Pepiot
@@ -23,20 +23,15 @@
 Classifier: Framework :: Pytest
 Requires-Python: >=3.9
 Description-Content-Type: text/x-rst
-License-File: LICENSE
-Requires-Dist: pytest>=6
 Provides-Extra: ansible
-Requires-Dist: ansible; extra == "ansible"
 Provides-Extra: docker
 Provides-Extra: kubectl
 Provides-Extra: local
 Provides-Extra: lxc
 Provides-Extra: paramiko
-Requires-Dist: paramiko; extra == "paramiko"
 Provides-Extra: salt
-Requires-Dist: salt; extra == "salt"
 Provides-Extra: winrm
-Requires-Dist: pywinrm; extra == "winrm"
+License-File: LICENSE
 
 ##################################
 Testinfra test your infrastructure
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-testinfra-10.1.0/test/test_modules.py 
new/pytest-testinfra-10.1.1/test/test_modules.py
--- old/pytest-testinfra-10.1.0/test/test_modules.py    2024-02-15 
06:02:21.000000000 +0100
+++ new/pytest-testinfra-10.1.1/test/test_modules.py    2024-05-26 
18:27:41.000000000 +0200
@@ -59,6 +59,17 @@
     assert python.version.startswith("3.11.")
 
 
+@pytest.mark.destructive
+@pytest.mark.testinfra_hosts("docker://rockylinux9")
+def test_rpmdb_corrupted(host):
+    host.check_output("dd if=/dev/zero of=/var/lib/rpm/rpmdb.sqlite bs=1024 
count=1")
+    with pytest.raises(RuntimeError) as excinfo:
+        host.package("zsh").is_installed
+    assert (
+        "Could not check if RPM package 'zsh' is installed. error: sqlite 
failure:"
+    ) in str(excinfo.value)
+
+
 @pytest.mark.testinfra_hosts("docker://rockylinux9")
 def test_non_default_package_tool(host):
     # Make non default pkg tool binary present
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-testinfra-10.1.0/testinfra/backend/ssh.py 
new/pytest-testinfra-10.1.1/testinfra/backend/ssh.py
--- old/pytest-testinfra-10.1.0/testinfra/backend/ssh.py        2024-02-15 
06:02:21.000000000 +0100
+++ new/pytest-testinfra-10.1.1/testinfra/backend/ssh.py        2024-05-26 
18:27:41.000000000 +0200
@@ -27,7 +27,7 @@
         ssh_config: Optional[str] = None,
         ssh_identity_file: Optional[str] = None,
         timeout: int = 10,
-        controlpath: str = "",
+        controlpath: Optional[str] = None,
         controlpersist: int = 60,
         ssh_extra_args: Optional[str] = None,
         *args: Any,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-testinfra-10.1.0/testinfra/modules/package.py 
new/pytest-testinfra-10.1.1/testinfra/modules/package.py
--- old/pytest-testinfra-10.1.0/testinfra/modules/package.py    2024-02-15 
06:02:21.000000000 +0100
+++ new/pytest-testinfra-10.1.1/testinfra/modules/package.py    2024-05-26 
18:27:41.000000000 +0200
@@ -165,7 +165,15 @@
 class RpmPackage(Package):
     @property
     def is_installed(self):
-        return self.run_test("rpm -q %s", self.name).rc == 0
+        result = self.run_test("rpm -q --quiet %s 2>&1", self.name)
+        if result.succeeded:
+            return True
+        elif result.failed and result.stdout == "":
+            return False
+        else:
+            raise RuntimeError(
+                f"Could not check if RPM package '{self.name}' is installed. 
{result.stdout}"
+            )
 
     @property
     def version(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-testinfra-10.1.0/testinfra/modules/service.py 
new/pytest-testinfra-10.1.1/testinfra/modules/service.py
--- old/pytest-testinfra-10.1.0/testinfra/modules/service.py    2024-02-15 
06:02:21.000000000 +0100
+++ new/pytest-testinfra-10.1.1/testinfra/modules/service.py    2024-05-26 
17:58:19.000000000 +0200
@@ -176,7 +176,7 @@
 
     @property
     def exists(self):
-        cmd = self.run_test('systemctl list-unit-files | grep -q"^%s"', 
self.name)
+        cmd = self.run_test('systemctl list-unit-files | grep -q "^%s"', 
self.name)
         return cmd.rc == 0
 
     @property
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pytest-testinfra-10.1.0/testinfra/utils/ansible_runner.py 
new/pytest-testinfra-10.1.1/testinfra/utils/ansible_runner.py
--- old/pytest-testinfra-10.1.0/testinfra/utils/ansible_runner.py       
2024-02-15 06:02:21.000000000 +0100
+++ new/pytest-testinfra-10.1.1/testinfra/utils/ansible_runner.py       
2024-05-26 18:27:41.000000000 +0200
@@ -187,13 +187,18 @@
 
     control_path = config.get("ssh_connection", "control_path", fallback="", 
raw=True)
     if control_path:
-        directory = config.get(
+        control_path_dir = config.get(
             "persistent_connection", "control_path_dir", 
fallback="~/.ansible/cp"
         )
-        control_path = control_path % ({"directory": directory})  # noqa: S001
-        # restore original "%%"
-        control_path = control_path.replace("%", "%%")
-        kwargs["controlpath"] = control_path
+        control_path_dir = os.path.expanduser(control_path_dir)
+        control_path_dir = os.path.normpath(control_path_dir)
+
+        if os.path.isdir(control_path_dir):
+            control_path = control_path % (  # noqa: S001
+                {"directory": control_path_dir}
+            )
+            control_path = control_path.replace("%", "%%")  # restore original 
"%%"
+            kwargs["controlpath"] = control_path
 
     spec = "{}://".format(connection)
 

Reply via email to