Skip to content

[BUG] The pkg.list_repo_pkgs method ignores repo arguments #58954

Open

Description

@golmaal

Description
On CentOS 7 or 8 machines, we configure 'excludes=kernel*' in /etc/yum.conf or /etc/dnf/dnf.conf to avoid unintentional upgrade of kernel related RPMs.
With such configuration when calling pkg.list_repo_pkgs with disableexcludes=main fails to list kernel RPMs.
E.g.

salt-call pkg.list_repo_pkgs kernel-modules-extra # fails correctly because kernel* is excluded
salt-call pkg.list_repo_pkgs kernel-modules-extra disableexcludes=main # fails incorrectly (due to unused repo_arg)
salt-call pkg.list_repo_pkgs kernel-modules-extra -- --disableexcludes=main # works however 2nd form above is used by pkg.installed and pkg.install state and execution methods, so those fail to install kernel-modules-extra until the bug is fixed.

repo_arg = _get_options(fromrepo=fromrepo, **kwargs)

Setup

# Start a CentOS:8.1.1911 container
curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
./bootstrap-salt.sh -P -M git v3002.1
echo 'excludes=kernel*' >> /etc/dnf/dnf.conf

Steps to Reproduce the behavior

salt-call pkg.list_repo_pkgs kernel-modules-extra disableexcludes=main

Expected behavior
The command under steps to reproduce should list kernel-modules-extra RPMs, however it returns empty.
Due to this issue, pkg.install and pkg.installed also fail when trying to get this RPM installed with disableexcludes=main option

Versions Report

salt --versions-report ``` Salt Version: Salt: 3002.1

Dependency Versions:
cffi: 1.11.5
cherrypy: Not Installed
dateutil: 2.6.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.11.2
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 1.0.0
mysql-python: Not Installed
pycparser: 2.14
pycrypto: 2.6.1
pycryptodome: 3.9.9
pygit2: Not Installed
Python: 3.6.8 (default, Nov 21 2019, 19:31:34)
python-gnupg: Not Installed
PyYAML: 5.3.1
PyZMQ: 20.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.3

System Versions:
dist: centos 8 Core
locale: UTF-8
machine: x86_64
release: 4.18.0-147.el8.x86_64
system: Linux
version: CentOS Linux 8 Core

</details>

Activity

  1. added
    bug
    on Nov 15, 2020
  2. added
    severity-medium
    and removed on Feb 16, 2021
  3. added this to the Approved milestone on Feb 16, 2021
  4. added
    severity-high
    and removed
    severity-medium
    on Feb 16, 2021
  5. modified the milestones: Approved, Silicon on Feb 16, 2021
  6. modified the milestones: Silicon, Approved on Aug 9, 2021
  7. added
    Sulfur v3006.0
    and removed
    Silicon v3004.0
    on Oct 25, 2021
  8. removed
    Sulfur v3006.0
    on Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugseverity-high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions