saltstack / saltstack/salt

[BUG] version of yumpkg.installed works abnormally.

Open
#66,059 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
version of pkg.installed in yum environment works abnormally.

If include an arch in the version, yumpkg.installed attempts to install using = rather than -. (1.24.0-1.el7.ngx.x86_64)
If there is no arch, it works fine. (1.24.0-1.el7.ngx)

Setup
Please be as specific as possible and give set-up details.

  • on-prem machine
  • onedir packaging

yumpkg_installed.sls

occur-error:
  pkg.installed:
    - name: nginx
    - version: 1.24.0-1.el7.ngx.x86_64

Steps to Reproduce the behavior
(Include debug logs if possible and relevant)

If you put arch in the version of yumpkg.installed state, you can see the following error.
It works normally if you don't put it in.

result

Function: pkg.installed
  Result: False
 Comment: The following packages failed to install/update: nginx=1.24.0-1.el7.ngx.x86_64

Expected behavior
A clear and concise description of what you expected to happen.

Try installing with nginx-1.24.0-1.el7.ngx.x86_64 rather than nginx=1.24.0-1.el7.ngx.x86_64

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (master)
Salt Version:
          Salt: 3005.1

Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.0
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
        Python: 3.9.16 (main, Jan  6 2023, 22:49:49)
  python-gnupg: 0.4.8
        PyYAML: 5.4.1
         PyZMQ: 23.2.0
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: ubuntu 18.04 bionic
        locale: utf-8
       machine: x86_64
       release: 4.15.0-20-generic
        system: Linux
       version: Ubuntu 18.04 bionic
salt-minion --versions-report (minion)
Salt Version:
          Salt: 3005.1

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.0
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
        Python: 3.9.16 (main, Jan  6 2023, 22:51:58)
  python-gnupg: 0.4.8
        PyYAML: 5.4.1
         PyZMQ: 23.2.0
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: centos 7 Core
        locale: utf-8
       machine: x86_64
       release: 3.10.0-957.21.3.el7.x86_64
        system: Linux
       version: CentOS Linux 7 Core

Additional context
When installing by specifying the version in the name, even if there is no arch, an error occurs even though the installation was actually successful.

yumpkg_installed.sls

occur-error:
  pkg.installed:
    - name: nginx-1.24.0-1.el7.ngx.x86_64

result

Function: pkg.installed
    Name: nginx-1.24.0-1.el7.ngx.x86_64
  Result: False
 Comment: The following packages failed to install/update: nginx-1.24.0-1.el7.ngx

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the pkg.installed state and the yum/yumpkg package-version handling, then reproduce the two version forms from the issue on the reported CentOS 7 setup. Trace why an architecture-qualified version uses the wrong separator and why installing by a versioned package name reports failure; done means both forms install successfully and return the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.