You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Since 3006.9 yumpkg does not work anymore on systems with Python versions below 3.8.
This is relevant for example when using salt-ssh.
The cause is simply the usage of the assignment/named expression in this fix: 00f6d42
This is the result when trying to use the pkg module with salt-ssh on a system with Python 3.6.8:
# salt-ssh xyz pkg.list_pkgs
xyz:
----------
retcode:
255
stderr:
'pkg.list_pkgs' is not available.
stdout:
[ERROR ] Failed to import module kernelpkg_linux_yum, this is due most likely to a syntax error:
Traceback (most recent call last):
File "/var/tmp/.root_78a1bd_salt/pyall/salt/loader/lazy.py", line 785, in _load_module
mod = self.run(spec.loader.load_module)
File "/var/tmp/.root_78a1bd_salt/pyall/salt/loader/lazy.py", line 1245, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/var/tmp/.root_78a1bd_salt/py3/contextvars/__init__.py", line 38, in run
return callable(*args, **kwargs)
File "/var/tmp/.root_78a1bd_salt/pyall/salt/loader/lazy.py", line 1260, in _run_as
ret = _func_or_method(*args, **kwargs)
File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 823, in load_module
File "<frozen importlib._bootstrap_external>", line 682, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/tmp/.root_78a1bd_salt/pyall/salt/modules/kernelpkg_linux_yum.py", line 8, in <module>
import salt.modules.yumpkg
File "/var/tmp/.root_78a1bd_salt/pyall/salt/modules/yumpkg.py", line 1427
if (version := kwargs.get("version")) is not None:
^
SyntaxError: invalid syntax
This is my proposed fix to get it working again:
- if (version := kwargs.get("version")) is not None:- kwargs["version"] = str(version)+ if kwargs.get("version") is not None:+ kwargs["version"] = str(kwargs["version"])
Versions Report
salt --versions-report
Salt Version:
Salt: 3006.9Python Version:
Python: 3.10.14 (main, Jun 26 2024, 11:44:37) [GCC 11.2.0]Dependency Versions:
cffi: 1.14.6cherrypy: unknowncryptography: 42.0.5dateutil: 2.8.1docker-py: Not Installedgitdb: Not Installedgitpython: Not InstalledJinja2: 3.1.4libgit2: Not Installedlooseversion: 1.0.2M2Crypto: Not InstalledMako: Not Installedmsgpack: 1.0.2msgpack-pure: Not Installedmysql-python: Not Installedpackaging: 22.0pycparser: 2.21pycrypto: Not Installedpycryptodome: 3.19.1pygit2: Not Installedpython-gnupg: 0.4.8PyYAML: 6.0.1PyZMQ: 23.2.0relenv: 0.17.0smmap: Not Installedtimelib: 0.2.4Tornado: 4.5.3ZMQ: 4.3.4System Versions:
dist: ubuntu 22.04.5 jammylocale: utf-8machine: x86_64release: 5.15.0-130-genericsystem: Linuxversion: Ubuntu 22.04.5 jammy
The text was updated successfully, but these errors were encountered:
Description
Since 3006.9 yumpkg does not work anymore on systems with Python versions below 3.8.
This is relevant for example when using salt-ssh.
The cause is simply the usage of the assignment/named expression in this fix: 00f6d42
This is the result when trying to use the pkg module with salt-ssh on a system with Python 3.6.8:
This is my proposed fix to get it working again:
Versions Report
salt --versions-report
The text was updated successfully, but these errors were encountered: