Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ansible-core for openSUSE:Factory 
checked in at 2025-05-27 18:44:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ansible-core (Old)
 and      /work/SRC/openSUSE:Factory/.ansible-core.new.2732 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ansible-core"

Tue May 27 18:44:30 2025 rev:44 rq:1280649 version:2.18.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/ansible-core/ansible-core.changes        
2025-05-20 17:04:06.065501749 +0200
+++ /work/SRC/openSUSE:Factory/.ansible-core.new.2732/ansible-core.changes      
2025-05-27 18:44:41.926884780 +0200
@@ -1,0 +2,7 @@
+Mon May 26 13:03:25 UTC 2025 - Harshvardhan Sharma 
<harshvardhan.sha...@suse.com>
+
+- Add patch suse-distribution-fix.patch to fix distribution.py
+  to identify the correct distribution for server-sap and micro
+  (#PED-12643) 
+
+-------------------------------------------------------------------

New:
----
  suse-distribution-fix.patch

BETA DEBUG BEGIN:
  New:
- Add patch suse-distribution-fix.patch to fix distribution.py
  to identify the correct distribution for server-sap and micro
BETA DEBUG END:

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

Other differences:
------------------
++++++ ansible-core.spec ++++++
--- /var/tmp/diff_new_pack.42MIBp/_old  2025-05-27 18:44:42.910926187 +0200
+++ /var/tmp/diff_new_pack.42MIBp/_new  2025-05-27 18:44:42.910926187 +0200
@@ -56,6 +56,9 @@
 # Upstream commit: d500354798beb9bf8341eb8e84e1e2046bbfd21b
 # Reference: 
https://github.com/ansible/ansible/commit/d500354798beb9bf8341eb8e84e1e2046bbfd21b
 Patch2:         unarchive-test-fix.patch
+# Patch to fix distribution.py to identify the correct distribution for 
server-sap and micro
+# Upstream pr https://github.com/ansible/ansible/pull/85152
+Patch3:         suse-distribution-fix.patch
 BuildArch:      noarch
 
 # cannot be installed with ansible < 3 or ansible-base

++++++ suse-distribution-fix.patch ++++++
>From 23f6105d9598c56c153ec637775a4579f8a8fe19 Mon Sep 17 00:00:00 2001
From: HVSharma12 <harshvardhan.sha...@suse.com>
Date: Mon, 26 May 2025 18:28:37 +0530
Subject: [PATCH] Adjust distribution detection logic for SUSE

---
 .../module_utils/facts/system/distribution.py | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/lib/ansible/module_utils/facts/system/distribution.py 
b/lib/ansible/module_utils/facts/system/distribution.py
index 7554ef1ae3..5ec94c92d1 100644
--- a/lib/ansible/module_utils/facts/system/distribution.py
+++ b/lib/ansible/module_utils/facts/system/distribution.py
@@ -311,9 +311,22 @@ class DistributionFiles:
                         suse_facts['distribution_release'] = release.group(1)
                         suse_facts['distribution_version'] = 
collected_facts['distribution_version'] + '.' + release.group(1)
 
-        # See https://www.suse.com/support/kb/doc/?id=000019341 for SLES for 
SAP
-        if os.path.islink('/etc/products.d/baseproduct') and 
os.path.realpath('/etc/products.d/baseproduct').endswith('SLES_SAP.prod'):
-            suse_facts['distribution'] = 'SLES_SAP'
+        # Check VARIANT_ID first for SLES4SAP or SL-Micro
+        variant_id_match = re.search(r'^VARIANT_ID="?([^"\n]*)"?', data, 
re.MULTILINE)
+        if variant_id_match:
+            variant_id = variant_id_match.group(1)
+            if variant_id in ('server-sap', 'sles-sap'):
+                suse_facts['distribution'] = 'SLES_SAP'
+            elif variant_id == 'transactional':
+                suse_facts['distribution'] = 'SL-Micro'
+        else:
+            # Fallback for older SLES 15 using baseproduct symlink
+            if os.path.islink('/etc/products.d/baseproduct'):
+                resolved = os.path.realpath('/etc/products.d/baseproduct')
+                if resolved.endswith('SLES_SAP.prod'):
+                    suse_facts['distribution'] = 'SLES_SAP'
+                elif resolved.endswith('SL-Micro.prod'):
+                    suse_facts['distribution'] = 'SL-Micro'
 
         return True, suse_facts
 
-- 
2.49.0

Reply via email to