Skip to content

Ensure latest pkg.info_installed ensure latest - #32243

Merged
terminalmage merged 12 commits into
saltstack:2015.8from
isbm:isbm-zypper-list-installed-ensure-latest
Mar 31, 2016
Merged

terminalmage merged 12 commits into
saltstack:2015.8from
isbm:isbm-zypper-list-installed-ensure-latest

Conversation

@isbm

@isbm isbm commented Mar 30, 2016

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Ensure that in case of multi-packages installed on the system, the latest is reported
  • Refactors scattered version comparison code for yumpkg, zypper and rpm

What issues does this PR fix or reference?

When there is installed multi-package, e.g. kernel-default, sometimes RPM does not returns properly sorted data, so it leads to accidental report of older version installed. While this is a general problem due to the fact that the structure is a deduplicated dictionary instead of list, still the latest version of the multi-package should be reported back, e.g. pkg.info_installed in Zypper.

Previous Behavior

Sometimes multi-package returns older version installed.

New Behavior

Multi-package always returns newest, latest version installed.

Tests written?

Yes

Comment thread salt/modules/rpm.py Outdated

def version_cmp(ver1, ver2):
'''
.. versionadded:: 2015.5.4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be changed to 2015.8.9

@terminalmage

Copy link
Copy Markdown
Contributor

I don't see a list_installed function in either yumpkg.py or zypper.py. Can you clarify?

@isbm isbm changed the title Ensure latest pkg.list_installed ensure latest Ensure latest pkg.info_installed ensure latest Mar 31, 2016
@isbm

isbm commented Mar 31, 2016

Copy link
Copy Markdown
Contributor Author

@terminalmage info_installed.

@terminalmage

Copy link
Copy Markdown
Contributor

OK, thanks. That's kind of what I thought, but wasn't sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants