Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] yumpkg.services_need_restart needlessly fails on recent Fedora #67177

Open
3 of 9 tasks
nf-brentsaner opened this issue Jan 18, 2025 · 5 comments
Open
3 of 9 tasks
Assignees
Labels
Bug broken, incorrect, or confusing behavior fedora affects this operating system

Comments

@nf-brentsaner
Copy link

Description
Fedora 41 uses DNF5.

The _yum() function in salt/modules/yumpkg.py returns dnf5.

However, the check in services_need_restart() only accounts for dnf, despite the command working fine in DNF 5 (dnf5), and needlessly fails:

# sha512sum `which dnf` ; sha512sum `which dnf5`
8ff23f3049841d00dab2861710717bc56a841f2754c469edffad2cd52c8219a75a6bec120cc7d5ce7762f7c407a87ccccdc1e80bc93dc97150d507feba0e942c  /usr/bin/dnf
8ff23f3049841d00dab2861710717bc56a841f2754c469edffad2cd52c8219a75a6bec120cc7d5ce7762f7c407a87ccccdc1e80bc93dc97150d507feba0e942c  /usr/bin/dnf5
# dnf --quiet needs-restarting
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.
# dnf5 --quiet needs-restarting
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.

Setup
Fedora 41 running Salt Minion 3007.1.

  • 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
N/A

Expected behavior
yumpkg properly detects dnf5 with the same consideration and condition path as dnf in services_need_restart() instead of raising CommandExecutionError("dnf is required to list outdated services.").

Screenshots
N/A

Versions Report
N/A; see above.

Additional context
N/A

@nf-brentsaner nf-brentsaner added Bug broken, incorrect, or confusing behavior needs-triage labels Jan 18, 2025
@ScriptAutomate
Copy link
Contributor

@dmurphy18
Copy link
Contributor

dmurphy18 commented Feb 26, 2025

@nf-brentsaner Please fill out the salt --versions report, it provides more information than just the version of Salt, dependencies installed for example.

And on Fedora 41 /usr/bin/dnf is a symbolic link to dnf5, so wondering what the problem is here, since any dnf is dnf5 on Fedora 41

@dmurphy18 dmurphy18 self-assigned this Feb 26, 2025
@dmurphy18 dmurphy18 added info-needed waiting for more info and removed needs-triage labels Feb 26, 2025
@nf-brentsaner
Copy link
Author

I mean. I literally told you why it fails and why it shouldn't, with a checksum demonstrating the same thing as an ls -l would.

Not sure what you think you're going to gleam from a versions report for an issue that is still present in current master that happens on behavior present on day 0 install of any install in the distro and release provided completely divorced of any "dependencies installed for example" given that it's part of the distro core, and visible with the naked human eye, but yeah.

Sure.

# salt-call --versions-report
Salt Version:
          Salt: 3007.1
 
Python Version:
        Python: 3.10.14 (main, Apr  3 2024, 21:30:09) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.16.0
      cherrypy: 18.8.0
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        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: Not Installed
       timelib: 0.3.0
       Tornado: 6.3.3
           ZMQ: 4.3.4
 
Salt Package Information:
  Package Type: onedir
 
System Versions:
          dist: fedora 41 
        locale: utf-8
       machine: x86_64
       release: 6.12.15-200.fc41.x86_64
        system: Linux
       version: Fedora Linux 41

@dmurphy18
Copy link
Contributor

@nf-brentsaner Reason for versions-report is due to checking python version or other dependencies used. Some users tick box for onedir, but then you see things like Python 3.12 which implies they used PyPI to install rather than the actual onedir package released from Salt, which would have Python 3.10, and tested against a specific set of dependencies. Stops the Salt Team from chasing phantoms, and issues which are unrelated to the packaged software, without knowing that.

Also makes sure of the Salt version, sometimes they think they are on a specific version, when they installed something else.

@dmurphy18
Copy link
Contributor

dmurphy18 commented Mar 3, 2025

Updated PR #67775 to handle dnf5 with services_need_restart to handle dnf5
Fixed and tests updated, awaiting other issues that the PR is handling.

@dmurphy18 dmurphy18 added fedora affects this operating system and removed info-needed waiting for more info labels Mar 3, 2025
@dmurphy18 dmurphy18 added this to the Sulfur v3006.10 milestone Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fedora affects this operating system
Projects
None yet
Development

No branches or pull requests

3 participants