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

list obsolete packages when using yum: list: updates #71673

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

dangel101
Copy link

@dangel101 dangel101 commented Sep 8, 2020

Fixes: #71558

Running the command with the option '--pkgnarrow=updates' gave empty results for RHVH hosts. Without it it shows the packages to update as expected
Also, the command didn't give any results with pkgspec option at the end of it, thus moving it to its beginning

The results for yum: list: updates with the playbook posted in the original issue are:
TASK [print check updates results] ***************************************************************************************************
ok: [192.168.100.170] => {
"my_updates": {
"changed": false,
"failed": false,
"results": [
{
"arch": "noarch",
"envra": "0:redhat-virtualization-host-image-update-4.3.11-20200825.0.el7_9.noarch",
"epoch": "0",
"name": "redhat-virtualization-host-image-update",
"release": "20200825.0.el7_9",
"repo": "rhvh4311-updates",
"version": "4.3.11",
"yumstate": "available"
}
]
}
}

Signed-off-by: Dana Elfassy delfassy@redhat.com

SUMMARY
ISSUE TYPE
  • Bugfix Pull Request
  • Docs Pull Request
  • Feature Pull Request
  • Test Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

@dangel101
Copy link
Author

dangel101 commented Sep 8, 2020

@mwperina @mnecas

@dangel101 dangel101 changed the title Working fix for yum check update list obsolete packages when using yum: list: updates Sep 8, 2020
@ansibot ansibot added affects_2.11 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 8, 2020
Copy link
Contributor

@mwperina mwperina left a comment

Please describe the issue precisely, we need to show which updates are not visible (worth to show exact use case with all those requires and obsolotes on concrete packages

@@ -661,7 +665,8 @@ def is_update(self, repoq, pkgspec, qf=def_qf):
if self.releasever:
myrepoq.extend('--releasever=%s' % self.releasever)

cmd = myrepoq + ["--pkgnarrow=updates", "--qf", qf, pkgspec]
cmd = myrepoq + ["--qf", qf] if self.is_ovirt_node() else myrepoq + ["--pkgnarrow=updates", "--qf", qf]
Copy link
Contributor

@mwperina mwperina Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, if you omit --pkgnarrow=updates, wouldn't you get all packages and not only those which are eligible for updates?

Copy link
Author

@dangel101 dangel101 Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omitting --pkgnarrow=updates entirely causes all packages to be listed when executing yum: list: updates on a regular host, and not only the packages that has an update

Copy link
Author

@dangel101 dangel101 Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding description - I added the results after the fix
The issue including the expected & current results, and the playbook tasks I ran are all in the original ticket: #71558

@@ -544,6 +544,10 @@ def is_group_env_installed(self, name):

return False

def is_ovirt_node(self):
with open('/etc/os-release') as f:
return 'VARIANT_ID="ovirt-node"' in f.read()
Copy link
Contributor

@mwperina mwperina Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's good to have an exception just for ovirt-node, can't we make it more common?

Copy link
Author

@dangel101 dangel101 Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue occurred on RHVH hosts, I figured it's the best way we can distinguish them from other hosts

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Sep 8, 2020
@Shrews Shrews removed the needs_triage Needs a first human triage before being processed. label Sep 15, 2020
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 23, 2020
@ansibot ansibot added pre_azp This PR was last tested before migration to Azure Pipelines. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Dec 4, 2020
@bcoca
Copy link
Member

bcoca commented Jan 12, 2022

/azp run

@azure-pipelines
Copy link

azure-pipelines bot commented Jan 12, 2022

Azure Pipelines successfully started running 1 pipeline(s).

@bcoca bcoca added needs_verified This issue needs to be verified/reproduced by maintainer P3 Priority 3 - Approved, No Time Limitation labels Jan 12, 2022
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. pre_azp This PR was last tested before migration to Azure Pipelines. core_review In order to be merged, this PR must follow the core review workflow. labels Jan 12, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 2, 2022
@sivel sivel unassigned relrod Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.11 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_verified This issue needs to be verified/reproduced by maintainer new_contributor This PR is the first contribution by a new community member. P3 Priority 3 - Approved, No Time Limitation packaging Packaging category stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

list: updates in yum module doesn't list obsolete packages
6 participants