touch up to yum module.

fix a couple of bugs
comment about state='latest'
This commit is contained in:
Seth Vidal 2012-03-10 02:19:57 -05:00
parent 209760f8f6
commit a99b491b32

View file

@ -77,7 +77,7 @@ def list_stuff(my, stuff):
s = 'disabled' s = 'disabled'
if repo.enabled: if repo.enabled:
s = 'enabled' s = 'enabled'
r[repo.id] = s t[repo.id] = s
r.append(t) r.append(t)
return r return r
@ -179,7 +179,12 @@ def ensure(my, state, pkgspec):
'failed': failed, 'failed': failed,
'results':out, 'results':out,
'errors': err } 'errors': err }
#if state == 'latest':
# check to see if this pkg is in an update
# if it is - update it and check to see if it applied
# if it is not - then return
# return { 'changed':False, 'failed':False, 'results':'', 'errors':'' }
return {'changed': False, return {'changed': False,
'failed': True, 'failed': True,
'results':'', 'results':'',
@ -205,9 +210,11 @@ def main():
# update="args"? # update="args"?
# #
results = {}
args = " ".join(sys.argv[1:]) args = " ".join(sys.argv[1:])
items = shlex.split(args) items = shlex.split(args)
# if nothing else changes - it fails
results = { 'changed':False, 'failed':True, 'results':'', 'errors':args }
params = {} params = {}
for x in items: for x in items:
(k, v) = x.split("=", 1) (k, v) = x.split("=", 1)