fix up latest so it behaves like latest should
if installed and updated available: apply update if not installed and available: install
This commit is contained in:
parent
ff6e4aef28
commit
91cabb5385
1 changed files with 8 additions and 4 deletions
12
yum
12
yum
|
@ -214,13 +214,17 @@ def ensure(my, state, pkgspec):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
if state == 'latest':
|
if state == 'latest':
|
||||||
if not [ pkg_to_dict(po) for
|
updates = my.doPackageLists(pkgnarrow='updates', patterns=[pkgspec]).updates
|
||||||
po in my.doPackageLists(pkgnarrow='updates', patterns=[pkgspec]).updates ]:
|
avail = my.doPackageLists(pkgnarrow='available', patterns=[pkgspec]).available
|
||||||
|
if not updates and not avail:
|
||||||
# there nothing in updates matching this.
|
# there nothing in updates matching this.
|
||||||
return { 'changed':False,}
|
return { 'changed':False,}
|
||||||
|
|
||||||
# we have something in updates
|
# we have something in updates or available
|
||||||
cmd = "yum -c %s -d1 -y update '%s'" % (yumconf, pkgspec)
|
if not updates:
|
||||||
|
cmd = "yum -c %s -d1 -y install '%s'" % (yumconf, pkgspec)
|
||||||
|
else:
|
||||||
|
cmd = "yum -c %s -d1 -y update '%s'" % (yumconf, pkgspec)
|
||||||
rc, out, err = run_yum(cmd)
|
rc, out, err = run_yum(cmd)
|
||||||
# FIXME if it is - update it and check to see if it applied
|
# FIXME if it is - update it and check to see if it applied
|
||||||
# check to see if there is no longer an update available for the pkgspec
|
# check to see if there is no longer an update available for the pkgspec
|
||||||
|
|
Loading…
Reference in a new issue