mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #938 from epoelke/develop
fix upgrade_available in yumpkg.py
This commit is contained in:
commit
f007f23794
@ -27,7 +27,6 @@ def __virtual__():
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def _list_removed(old, new):
|
||||
'''
|
||||
List the packages which have been removed between the two package objects
|
||||
@ -39,7 +38,6 @@ def _list_removed(old, new):
|
||||
|
||||
return pkgs
|
||||
|
||||
|
||||
def _compare_versions(old, new):
|
||||
'''
|
||||
Returns a dict that that displays old and new versions for a package after
|
||||
@ -61,7 +59,6 @@ def _compare_versions(old, new):
|
||||
'new': new[npkg]}
|
||||
return pkgs
|
||||
|
||||
|
||||
def available_version(name):
|
||||
'''
|
||||
The available version of the package in the repository
|
||||
@ -96,7 +93,6 @@ def available_version(name):
|
||||
# remove the duplicate items from the list and return the first one
|
||||
return list(set(versions_list))[0]
|
||||
|
||||
|
||||
def upgrade_available(name):
|
||||
'''
|
||||
Check whether or not an upgrade is available for a given package
|
||||
@ -105,11 +101,7 @@ def upgrade_available(name):
|
||||
|
||||
salt '*' pkg.upgrade_available <package name>
|
||||
'''
|
||||
if available_version(name):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
return available_version(name)
|
||||
|
||||
def version(name):
|
||||
'''
|
||||
@ -125,7 +117,6 @@ def version(name):
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
||||
def list_pkgs(*args):
|
||||
'''
|
||||
List the packages currently installed in a dict::
|
||||
@ -150,7 +141,6 @@ def list_pkgs(*args):
|
||||
|
||||
return pkgs
|
||||
|
||||
|
||||
def refresh_db():
|
||||
'''
|
||||
Since yum refreshes the database automatically, this runs a yum clean,
|
||||
@ -164,7 +154,6 @@ def refresh_db():
|
||||
yb.cleanMetadata()
|
||||
return True
|
||||
|
||||
|
||||
def clean_metadata():
|
||||
'''
|
||||
Cleans local yum metadata.
|
||||
@ -232,7 +221,6 @@ def install(pkgs, refresh=False, repo='', skip_verify=False, **kwargs):
|
||||
|
||||
return _compare_versions(old, new)
|
||||
|
||||
|
||||
def upgrade():
|
||||
'''
|
||||
Run a full system upgrade, a yum upgrade
|
||||
@ -263,7 +251,6 @@ def upgrade():
|
||||
new = list_pkgs()
|
||||
return _compare_versions(old, new)
|
||||
|
||||
|
||||
def remove(pkgs):
|
||||
'''
|
||||
Removes packages with yum remove
|
||||
@ -292,7 +279,6 @@ def remove(pkgs):
|
||||
|
||||
return _list_removed(old, new)
|
||||
|
||||
|
||||
def purge(pkgs):
|
||||
'''
|
||||
Yum does not have a purge, this function calls remove
|
||||
|
Loading…
Reference in New Issue
Block a user