mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-11 19:04:02 -07:00
Bulk autopep8 (modules)
As agreed in 2017-12-07 Core meeting bulk fix pep8 issues Generated using: autopep8 1.3.3 (pycodestyle: 2.3.1) autopep8 -r --max-line-length 160 --in-place --ignore E305,E402,E722,E741 lib/ansible/modules Manually fix issues that autopep8 has introduced
This commit is contained in:
parent
d13d7e9404
commit
c57a7f05e1
314 changed files with 3462 additions and 3383 deletions
|
@ -83,6 +83,7 @@ def get_local_version(pear_output):
|
|||
return installed
|
||||
return None
|
||||
|
||||
|
||||
def _get_pear_path(module):
|
||||
if module.params['executable'] and os.path.isfile(module.params['executable']):
|
||||
result = module.params['executable']
|
||||
|
@ -90,6 +91,7 @@ def _get_pear_path(module):
|
|||
result = module.get_bin_path('pear', True, [module.params['executable']])
|
||||
return result
|
||||
|
||||
|
||||
def get_repository_version(pear_output):
|
||||
"""Take pear remote-info output and get the latest version"""
|
||||
lines = pear_output.split('\n')
|
||||
|
@ -98,6 +100,7 @@ def get_repository_version(pear_output):
|
|||
return line.rsplit(None, 1)[-1].strip()
|
||||
return None
|
||||
|
||||
|
||||
def query_package(module, name, state="present"):
|
||||
"""Query the package status in both the local system and the repository.
|
||||
Returns a boolean to indicate if the package is installed,
|
||||
|
@ -198,18 +201,14 @@ def check_packages(module, packages, state):
|
|||
module.exit_json(change=False, msg="package(s) already %s" % state)
|
||||
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
name = dict(aliases=['pkg']),
|
||||
state = dict(default='present', choices=['present', 'installed', "latest", 'absent', 'removed']),
|
||||
executable = dict(default=None, required=False, type='path')),
|
||||
required_one_of = [['name']],
|
||||
supports_check_mode = True)
|
||||
|
||||
|
||||
argument_spec=dict(
|
||||
name=dict(aliases=['pkg']),
|
||||
state=dict(default='present', choices=['present', 'installed', "latest", 'absent', 'removed']),
|
||||
executable=dict(default=None, required=False, type='path')),
|
||||
required_one_of=[['name']],
|
||||
supports_check_mode=True)
|
||||
|
||||
p = module.params
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue