Open ijansky opened 4 years ago
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at core@saltstack.com or reach out directly to the Community Manager, Cassandra Faris via Slack. We’re glad you’ve joined our community and look forward to doing awesome things with you!
This issue has been approved to be fixed in a future release of salt.
Description The modules.ebuildpkg.installed module function has an extra argument
slot
that installs the latest available version in the specified slot. According to the documentation it is ignored ifpkgs
orsources
orversion
arguments are passed to the function. However, when the function is called from the states.pkg.installed state function, theslot
argument is ignored, because thestates.pkg.installed
state function calls the module function with thepkgs
argument - even for single package states. See the additional context section for details.I am not sure whether this is an issue with the implementation of
modules.ebuildpkg.installed
orstates.pkg.installed
.Setup Gentoo box running salt and the following SLS file.
Steps to Reproduce the behavior The issue can be reproduced by executing the SLS file mentioned above or by running the following command:
Notice that the
name
argument is set to None, while thepkgs
argument is passed in with one item equal to the package name.Expected behavior The package should be installed with the desired slot version. In this particular case, the expectations is to install
dev-db/postgresql:10
.Versions Report
salt --versions-report
``` Salt Version: Salt: 3001.1 Dependency Versions: cffi: 1.14.0 cherrypy: Not Installed dateutil: Not Installed docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed Jinja2: 2.11.2 libgit2: 1.0.1 M2Crypto: Not Installed Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 1.0.0 mysql-python: Not Installed pycparser: 2.20 pycrypto: 3.9.8 pycryptodome: 3.9.8 pygit2: 1.2.1 Python: 3.8.5 (default, Sep 17 2020, 21:17:31) python-gnupg: Not Installed PyYAML: 5.3.1 PyZMQ: 19.0.1 smmap: Not Installed timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.3.2 System Versions: dist: gentoo 2.7 locale: utf-8 machine: x86_64 release: 5.4.64 system: Linux version: Gentoo 2.7 ```Additional context
State function packing the
name
argument into apkgs
array. https://github.com/saltstack/salt/blob/e941aa8fd207bb2addd1caa5ffe26cd9ae966095/salt/states/pkg.py#L1685-L1692Module function not executing due to
pkgs
being set. https://github.com/saltstack/salt/blob/e941aa8fd207bb2addd1caa5ffe26cd9ae966095/salt/modules/ebuildpkg.py#L676-L687