8000 add upgrade_available() by terminalmage · Pull Request #805 · saltstack/salt · GitHub
[go: up one dir, main page]

Skip to content

add upgrade_available() #805

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

Merged
merged 1 commit into from
Mar 1, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions salt/modules/yumpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ def available_version(name):
return list(set(versions_list))[0]


def upgrade_available(name):
'''
Check whether or not an upgrade is available for a given package

CLI Example::

salt '*' pkg.upgrade_available <package name>
'''
if available_version(name):
return True
else:
return False


def version(name):
'''
Returns a version if the package is installed, else returns an empty string
Expand Down
11 changes: 11 additions & 0 deletions salt/modules/yumpkg5.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ def available_version(name):
return out[0].version if out else ''


def upgrade_available(name):
'''
Check whether or not an upgrade is available for a given package

CLI Example::

salt '*' pkg.upgrade_available <package name>
'''
return available_version(name) != ''


def version(name):
'''
Returns a version if the package is installed, else returns an empty string
Expand Down
0