Repository navigation
Description
Description
In 3007.0 and newer, modules/win_pkg.py is missing the function pkg.list_repo_pkgs which is required when running with test=True.
This is related to the introduction of the feature in #63986.
Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
Master or masterless minion needs to be set-up for Winrepo (winrepo.update_git_repos has been called).
Please be as specific as possible and give set-up details.
- on-prem machine
- VM (Virtualbox, KVM, etc. please specify)
- VM running on a cloud service, please be explicit and add details
- container (Kubernetes, Docker, containerd, etc. please specify)
- or a combination, please be explicit
- jails if it is FreeBSD
- classic packaging
- onedir packaging
- used bootstrap to install
Steps to Reproduce the behavior
(Include debug logs if possible and relevant)
Examples:
salt <minion> state.single pkg.installed putty test=True
or
salt-call --local state.single pkg.latest putty test=True
results in:
[ERROR ] An exception occurred in this state: Traceback (most recent call last):
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\state.py", line 2428, in call
ret = self.states[cdata["full"]](
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\loader\lazy.py", line 160, in __call__
ret = self.loader.run(run_func, *args, **kwargs)
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\loader\lazy.py", line 1269, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\loader\lazy.py", line 1284, in _run_as
return _func_or_method(*args, **kwargs)
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\loader\lazy.py", line 1317, in wrapper
return f(*args, **kwargs)
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\states\pkg.py", line 2815, in latest
changes = _get_installable_versions(targets, cur)
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\states\pkg.py", line 1033, in _get_installable_versions
explicit_versions = __salt__["pkg.list_repo_pkgs"](*explicit_targets)
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\loader\context.py", line 86, in __getitem__
return self.value()[item]
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\loader\lazy.py", line 384, in __getitem__
_ = super().__getitem__(item) # try to get the item from the dictionary
File "C:\Program Files\Salt Project\Salt\Lib\site-packages\salt\utils\lazy.py", line 104, in __getitem__
raise KeyError(key)
KeyError: 'pkg.list_repo_pkgs'
Expected behavior
No raised exception and result of the test state application to be displayed.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Salt Version:
Salt: 3007.1
Python Version:
Python: 3.10.14 (heads/main:c1ec015, Apr 3 2024, 21:36:37) [MSC v.1938 64 bit (AMD64)]
Dependency Versions:
cffi: 1.16.0
cherrypy: 18.8.0
dateutil: 2.8.2
docker-py: Not Installed
gitdb: 4.0.10
gitpython: 3.1.43
Jinja2: 3.1.4
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.7
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 23.1
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.5.2
PyYAML: 6.0.1
PyZMQ: 25.1.2
relenv: 0.16.0
smmap: 5.0.1
timelib: 0.3.0
Tornado: 6.3.3
ZMQ: 4.3.4
Salt Package Information:
Package Type: onedir
System Versions:
dist:
locale: utf-8
machine: AMD64
release: 10
system: Windows
version: 10 10.0.26100 SP0 Multiprocessor FreeAdditional context
Ref. @twangboy
Activity