mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
yum: PEP8 compliancy and documentation changes (#33424)
This PR includes: - PEP8 compliancy changes - documentation changes
This commit is contained in:
parent
52a8644a15
commit
e0c94aa6a7
2 changed files with 18 additions and 14 deletions
|
@ -34,7 +34,7 @@ options:
|
||||||
aliases: [ pkg ]
|
aliases: [ pkg ]
|
||||||
exclude:
|
exclude:
|
||||||
description:
|
description:
|
||||||
- "Package name(s) to exclude when state=present, or latest"
|
- Package name(s) to exclude when state=present, or latest
|
||||||
version_added: "2.0"
|
version_added: "2.0"
|
||||||
list:
|
list:
|
||||||
description:
|
description:
|
||||||
|
@ -153,9 +153,9 @@ requirements:
|
||||||
author:
|
author:
|
||||||
- Ansible Core Team
|
- Ansible Core Team
|
||||||
- Seth Vidal
|
- Seth Vidal
|
||||||
- Eduard Snesarev (github.com/verm666)
|
- Eduard Snesarev (@verm666)
|
||||||
- Berend De Schouwer (github.com/berenddeschouwer)
|
- Berend De Schouwer (@berenddeschouwer)
|
||||||
- Abhijeet Kasurde (github.com/akasurde)
|
- Abhijeet Kasurde (@Akasurde)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
@ -256,7 +256,7 @@ def yum_base(conf_file=None, installroot='/'):
|
||||||
my.preconf.debuglevel = 0
|
my.preconf.debuglevel = 0
|
||||||
my.preconf.errorlevel = 0
|
my.preconf.errorlevel = 0
|
||||||
my.preconf.plugins = True
|
my.preconf.plugins = True
|
||||||
#my.preconf.releasever = '/'
|
# my.preconf.releasever = '/'
|
||||||
if installroot != '/':
|
if installroot != '/':
|
||||||
# do not setup installroot by default, because of error
|
# do not setup installroot by default, because of error
|
||||||
# CRITICAL:yum.cli:Config Error: Error accessing file for config file:////etc/yum.conf
|
# CRITICAL:yum.cli:Config Error: Error accessing file for config file:////etc/yum.conf
|
||||||
|
@ -662,15 +662,18 @@ def list_stuff(module, repoquerybin, conf_file, stuff, installroot='/', disabler
|
||||||
|
|
||||||
if stuff == 'installed':
|
if stuff == 'installed':
|
||||||
return [pkg_to_dict(p) for p in sorted(is_installed(module, repoq, '-a', conf_file, qf=is_installed_qf, installroot=installroot)) if p.strip()]
|
return [pkg_to_dict(p) for p in sorted(is_installed(module, repoq, '-a', conf_file, qf=is_installed_qf, installroot=installroot)) if p.strip()]
|
||||||
elif stuff == 'updates':
|
|
||||||
|
if stuff == 'updates':
|
||||||
return [pkg_to_dict(p) for p in sorted(is_update(module, repoq, '-a', conf_file, qf=qf, installroot=installroot)) if p.strip()]
|
return [pkg_to_dict(p) for p in sorted(is_update(module, repoq, '-a', conf_file, qf=qf, installroot=installroot)) if p.strip()]
|
||||||
elif stuff == 'available':
|
|
||||||
|
if stuff == 'available':
|
||||||
return [pkg_to_dict(p) for p in sorted(is_available(module, repoq, '-a', conf_file, qf=qf, installroot=installroot)) if p.strip()]
|
return [pkg_to_dict(p) for p in sorted(is_available(module, repoq, '-a', conf_file, qf=qf, installroot=installroot)) if p.strip()]
|
||||||
elif stuff == 'repos':
|
|
||||||
|
if stuff == 'repos':
|
||||||
return [dict(repoid=name, state='enabled') for name in sorted(repolist(module, repoq)) if name.strip()]
|
return [dict(repoid=name, state='enabled') for name in sorted(repolist(module, repoq)) if name.strip()]
|
||||||
else:
|
|
||||||
return [pkg_to_dict(p) for p in sorted(is_installed(module, repoq, stuff, conf_file, qf=is_installed_qf, installroot=installroot)+
|
return [pkg_to_dict(p) for p in sorted(is_installed(module, repoq, stuff, conf_file, qf=is_installed_qf, installroot=installroot) +
|
||||||
is_available(module, repoq, stuff, conf_file, qf=qf, installroot=installroot)) if p.strip()]
|
is_available(module, repoq, stuff, conf_file, qf=qf, installroot=installroot)) if p.strip()]
|
||||||
|
|
||||||
|
|
||||||
def exec_install(module, items, action, pkgs, res, yum_basecmd):
|
def exec_install(module, items, action, pkgs, res, yum_basecmd):
|
||||||
|
@ -1348,8 +1351,10 @@ def main():
|
||||||
disablerepo, disable_gpg_check, exclude, repoquery,
|
disablerepo, disable_gpg_check, exclude, repoquery,
|
||||||
skip_broken, update_only, security, params['installroot'], allow_downgrade)
|
skip_broken, update_only, security, params['installroot'], allow_downgrade)
|
||||||
if repoquery:
|
if repoquery:
|
||||||
results['msg'] = '%s %s' % (results.get('msg', ''),
|
results['msg'] = '%s %s' % (
|
||||||
'Warning: Due to potential bad behaviour with rhnplugin and certificates, used slower repoquery calls instead of Yum API.')
|
results.get('msg', ''),
|
||||||
|
'Warning: Due to potential bad behaviour with rhnplugin and certificates, used slower repoquery calls instead of Yum API.'
|
||||||
|
)
|
||||||
|
|
||||||
module.exit_json(**results)
|
module.exit_json(**results)
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,6 @@ lib/ansible/modules/packaging/os/sorcery.py
|
||||||
lib/ansible/modules/packaging/os/svr4pkg.py
|
lib/ansible/modules/packaging/os/svr4pkg.py
|
||||||
lib/ansible/modules/packaging/os/swdepot.py
|
lib/ansible/modules/packaging/os/swdepot.py
|
||||||
lib/ansible/modules/packaging/os/urpmi.py
|
lib/ansible/modules/packaging/os/urpmi.py
|
||||||
lib/ansible/modules/packaging/os/yum.py
|
|
||||||
lib/ansible/modules/packaging/os/zypper.py
|
lib/ansible/modules/packaging/os/zypper.py
|
||||||
lib/ansible/modules/packaging/os/zypper_repository.py
|
lib/ansible/modules/packaging/os/zypper_repository.py
|
||||||
lib/ansible/modules/storage/infinidat/infini_export.py
|
lib/ansible/modules/storage/infinidat/infini_export.py
|
||||||
|
|
Loading…
Reference in a new issue