File fix-the-aptpkg.py-unit-test-failure.patch of Package salt

From 6fd45ee5fd53c422ed147f65a1787e613fa53f96 Mon Sep 17 00:00:00 2001
From: Marek Czernek <marek.czernek@suse.com>
Date: Wed, 17 Jan 2024 15:04:53 +0100
Subject: [PATCH] Fix the aptpkg.py unit test failure

---
 salt/modules/aptpkg.py | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py
index e50ca2fe1b..179da1a0ec 100644
--- a/salt/modules/aptpkg.py
+++ b/salt/modules/aptpkg.py
@@ -2730,6 +2730,39 @@ def _expand_repo_def(os_name, os_codename=None, **kwargs):
     return sanitized
 
 
+def expand_repo_def(**kwargs):
+    """
+    Take a repository definition and expand it to the full pkg repository dict
+    that can be used for comparison.  This is a helper function to make
+    the Debian/Ubuntu apt sources sane for comparison in the pkgrepo states.
+
+    This is designed to be called from pkgrepo states and will have little use
+    being called on the CLI.
+
+    CLI Examples:
+
+    .. code-block:: bash
+
+        NOT USABLE IN THE CLI
+    """
+    warn_until_date(
+        "20250101",
+        "The pkg.expand_repo_def function is deprecated and set for removal "
+        "after {date}. This is only unsed internally by the apt pkg state "
+        "module. If that's not the case, please file an new issue requesting "
+        "the removal of this deprecation warning",
+        stacklevel=3,
+    )
+    if "os_name" not in kwargs:
+        kwargs["os_name"] = __grains__["os"]
+    if "os_codename" not in kwargs:
+        if "lsb_distrib_codename" in kwargs:
+            kwargs["os_codename"] = kwargs["lsb_distrib_codename"]
+        else:
+            kwargs["os_codename"] = __grains__.get("oscodename")
+    return _expand_repo_def(**kwargs)
+
+
 def _parse_selections(dpkgselection):
     """
     Parses the format from ``dpkg --get-selections`` and return a format that
-- 
2.47.0

openSUSE Build Service is sponsored by