saltstack / saltstack/salt

[BUG] YUMPKG.refresh_db does not report error if repo unavailable

Open
#60,163 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
yumpkg module has refresh_db to check repos for updated packages.
Returns are:
True: Updates are available
False: An error occurred
None: No updates are available

If the minion cannot reach a repo, it still returns None instead of False

Setup
Fedora-32 master/minion from fresh 3003 install.

Steps to Reproduce the behavior
Take master/minion offline
Run yumpkg.refresh_db module

Expected behavior
Output will show "False"

Versions Report
I'm not on that machine currently, but it is fresh install of Fedora-32 with new install 3003.

Additional context
When machine is online, module works as expected and reports appropriately - tested with new packages to generate True report.
Output does not report when repository cannot be reached - should this not be reported as an error, with False returned?

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 with the yumpkg.refresh_db entry point and reproduce the behavior with the minion unable to reach a repository. Trace how repository access failures are handled and verify the documented return values: True for available updates, None for no updates, and False for an error. Add or update coverage for the offline-repository case and run the relevant yumpkg tests.

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.