Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2025-09-12 21:09:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.1977 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "salt-shaptools" Fri Sep 12 21:09:36 2025 rev:27 rq:1304104 version:0.3.19+git.1757602235.33fff4c Changes: -------- --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2025-09-11 14:47:17.683971525 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.1977/salt-shaptools.changes 2025-09-12 21:09:51.084040145 +0200 @@ -5 +5 @@ - * Fix crmsh import usage using python3 absolute path. This enables + * Fix crmsh import usage using crm binary python version. This enables Old: ---- salt-shaptools-0.3.19+git.1757585149.46def27.tar.gz New: ---- salt-shaptools-0.3.19+git.1757602235.33fff4c.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ salt-shaptools.spec ++++++ --- /var/tmp/diff_new_pack.bpyJkb/_old 2025-09-12 21:09:51.532059038 +0200 +++ /var/tmp/diff_new_pack.bpyJkb/_new 2025-09-12 21:09:51.536059205 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version: 0.3.19+git.1757585149.46def27 +Version: 0.3.19+git.1757602235.33fff4c Release: 0 Summary: Salt modules and states for SAP Applications and SLE-HA components management ++++++ _service ++++++ --- /var/tmp/diff_new_pack.bpyJkb/_old 2025-09-12 21:09:51.564060387 +0200 +++ /var/tmp/diff_new_pack.bpyJkb/_new 2025-09-12 21:09:51.568060555 +0200 @@ -5,7 +5,7 @@ <param name="exclude">.git</param> <param name="filename">salt-shaptools</param> <param name="versionformat">0.3.19+git.%ct.%h</param> - <param name="revision">46def27705c1301f774730da9b6786ee8d329238</param> + <param name="revision">33fff4c58c68361b2bdbbf15cba3defb03e628aa</param> </service> <service name="recompress" mode="disabled"> ++++++ salt-shaptools-0.3.19+git.1757585149.46def27.tar.gz -> salt-shaptools-0.3.19+git.1757602235.33fff4c.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.19+git.1757585149.46def27/salt/modules/crmshmod.py new/salt-shaptools-0.3.19+git.1757602235.33fff4c/salt/modules/crmshmod.py --- old/salt-shaptools-0.3.19+git.1757585149.46def27/salt/modules/crmshmod.py 2025-09-11 12:05:49.000000000 +0200 +++ new/salt-shaptools-0.3.19+git.1757602235.33fff4c/salt/modules/crmshmod.py 2025-09-11 16:50:35.000000000 +0200 @@ -27,6 +27,7 @@ from salt import exceptions import salt.utils.path +import salt.utils.files __virtualname__ = 'crm' @@ -38,6 +39,7 @@ # Below this version ha-cluster-init will be used to create the cluster CRM_NEW_VERSION = '3.0.0' COROSYNC_CONF = '/etc/corosync/corosync.conf' +DEFAULT_CRM_PYTHON_BIN = '/usr/bin/python3' LOGGER = logging.getLogger(__name__) # True if current execution has a newer version than CRM_NEW_VERSION @@ -63,9 +65,17 @@ False, 'The crmsh execution module failed to load: the ha-cluster-init' ' package is not available.') + + try: + with salt.utils.files.fopen(CRM_COMMAND) as file: + shebang_line = file.readline().strip() + crm_python_version = shebang_line.split("#!")[1] + except: + crm_python_version = DEFAULT_CRM_PYTHON_BIN __context__['crm.version'] = version __context__['crm.use_crm'] = use_crm + __context__['crm.python_version'] = crm_python_version return __virtualname__ @@ -683,7 +693,9 @@ def detect_cloud(): ''' - Detect if crmsh is being executed in some cloud provider + Detect if crmsh is being executed in some cloud provider. + It reads `crm` command shebang from the binary file to get the specific python version. + The crm command shebang might be altered during the package build process These are the currently known platforms: * amazon-web-services @@ -691,7 +703,8 @@ * google-cloud-platform * None (as string)(otherwise) ''' - cmd = '/usr/bin/python3 -c "from crmsh import utils; print(utils.detect_cloud());"' + cmd = '{} -c "from crmsh import utils; print(utils.detect_cloud());"'.format( + __context__['crm.python_version']) provider = __salt__['cmd.run'](cmd).strip() return provider diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.19+git.1757585149.46def27/salt-shaptools.changes new/salt-shaptools-0.3.19+git.1757602235.33fff4c/salt-shaptools.changes --- old/salt-shaptools-0.3.19+git.1757585149.46def27/salt-shaptools.changes 2025-09-11 12:05:49.000000000 +0200 +++ new/salt-shaptools-0.3.19+git.1757602235.33fff4c/salt-shaptools.changes 2025-09-11 16:50:35.000000000 +0200 @@ -2,7 +2,7 @@ Wed Sep 10 09:31:31 UTC 2025 - Xabier Arbulu <xarb...@suse.com> - Version 0.3.19 - * Fix crmsh import usage using python3 absolute path. This enables + * Fix crmsh import usage using crm binary python version. This enables salt modules/states correct usage when the Salt Bundle is used (bsc#1248174) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.19+git.1757585149.46def27/tests/unit/modules/test_crmshmod.py new/salt-shaptools-0.3.19+git.1757602235.33fff4c/tests/unit/modules/test_crmshmod.py --- old/salt-shaptools-0.3.19+git.1757585149.46def27/tests/unit/modules/test_crmshmod.py 2025-09-11 12:05:49.000000000 +0200 +++ new/salt-shaptools-0.3.19+git.1757602235.33fff4c/tests/unit/modules/test_crmshmod.py 2025-09-11 16:50:35.000000000 +0200 @@ -16,7 +16,8 @@ from tests.support import mock from tests.support.mock import ( MagicMock, - patch + patch, + mock_open ) # Import Salt Libs @@ -62,11 +63,12 @@ with patch.dict(crmshmod.__salt__, { 'pkg.version': mock_pkg_version, 'pkg.version_cmp': mock_pkg_version_cmp}): - assert crmshmod.__virtual__() == 'crm' - mock_which.assert_has_calls([ - mock.call(crmshmod.CRM_COMMAND), - mock.call(crmshmod.HA_INIT_COMMAND) - ]) + with patch('salt.utils.files.fopen', mock_open(read_data='#!/usr/bin/python3.11\n')) as mock_fopen: + assert crmshmod.__virtual__() == 'crm' + mock_which.assert_has_calls([ + mock.call(crmshmod.CRM_COMMAND), + mock.call(crmshmod.HA_INIT_COMMAND) + ]) @mock.patch('salt.utils.path.which') def test_virtual_ha_error(self, mock_which): @@ -757,10 +759,11 @@ Test detect_cloud ''' mock_cmd_run = MagicMock(return_value='my-cloud ') - - with patch.dict(crmshmod.__salt__, {'cmd.run': mock_cmd_run}): - result = crmshmod.detect_cloud() - assert result == 'my-cloud' + + with patch.dict(crmshmod.__context__, {'crm.python_version': '/usr/bin/python3'}): + with patch.dict(crmshmod.__salt__, {'cmd.run': mock_cmd_run}): + result = crmshmod.detect_cloud() + assert result == 'my-cloud' mock_cmd_run.assert_called_once_with( '/usr/bin/python3 -c "from crmsh import utils; print(utils.detect_cloud());"')