1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

module must be passed to repolist too

This commit is contained in:
Daniel Hokka Zakrisson 2013-01-22 16:27:08 +01:00
parent 7fadf6c976
commit 48f48e8a44

View file

@ -297,7 +297,7 @@ def pkg_to_dict(pkgstr):
return d return d
def repolist(repoq, qf="%{repoid}"): def repolist(module, repoq, qf="%{repoid}"):
cmd = repoq + ["--qf", qf, "-a"] cmd = repoq + ["--qf", qf, "-a"]
rc,out,err = module.run_command(cmd) rc,out,err = module.run_command(cmd)
@ -320,7 +320,7 @@ def list_stuff(module, conf_file, stuff):
elif stuff == 'available': elif stuff == 'available':
return [ pkg_to_dict(p) for p in is_available(module, repoq, '-a', conf_file, qf=qf) if p.strip() ] return [ pkg_to_dict(p) for p in is_available(module, repoq, '-a', conf_file, qf=qf) if p.strip() ]
elif stuff == 'repos': elif stuff == 'repos':
return [ dict(repoid=name, state='enabled') for name in repolist(repoq) if name.strip() ] return [ dict(repoid=name, state='enabled') for name in repolist(module, repoq) if name.strip() ]
else: else:
return [ pkg_to_dict(p) for p in is_installed(module, repoq, stuff, conf_file, qf=qf) + is_available(module, repoq, stuff, conf_file, qf=qf) if p.strip() ] return [ pkg_to_dict(p) for p in is_installed(module, repoq, stuff, conf_file, qf=qf) + is_available(module, repoq, stuff, conf_file, qf=qf) if p.strip() ]