mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
pkg5_publisher: Fix on failed, PEP8 compliancy (#26019)
This commit is contained in:
parent
9b31ca8d16
commit
a1876bac9c
2 changed files with 7 additions and 3 deletions
|
@ -75,6 +75,7 @@ EXAMPLES = '''
|
|||
origin: 'https://pkg.example.com/site/'
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
|
@ -145,11 +146,13 @@ def set_publisher(module, params):
|
|||
'msg': err,
|
||||
'changed': True,
|
||||
}
|
||||
if rc != 0:
|
||||
module.fail_json(**response)
|
||||
module.exit_json(**response)
|
||||
|
||||
|
||||
def unset_publisher(module, publisher):
|
||||
if not publisher in get_publishers(module):
|
||||
if publisher not in get_publishers(module):
|
||||
module.exit_json()
|
||||
|
||||
rc, out, err = module.run_command(
|
||||
|
@ -162,6 +165,8 @@ def unset_publisher(module, publisher):
|
|||
'msg': err,
|
||||
'changed': True,
|
||||
}
|
||||
if rc != 0:
|
||||
module.fail_json(**response)
|
||||
module.exit_json(**response)
|
||||
|
||||
|
||||
|
@ -176,7 +181,7 @@ def get_publishers(module):
|
|||
values = dict(zip(keys, map(unstringify, line.split("\t"))))
|
||||
name = values['publisher']
|
||||
|
||||
if not name in publishers:
|
||||
if name not in publishers:
|
||||
publishers[name] = dict(
|
||||
(k, values[k]) for k in ['sticky', 'enabled']
|
||||
)
|
||||
|
|
|
@ -387,7 +387,6 @@ lib/ansible/modules/packaging/os/macports.py
|
|||
lib/ansible/modules/packaging/os/opkg.py
|
||||
lib/ansible/modules/packaging/os/pacman.py
|
||||
lib/ansible/modules/packaging/os/pkg5.py
|
||||
lib/ansible/modules/packaging/os/pkg5_publisher.py
|
||||
lib/ansible/modules/packaging/os/pkgin.py
|
||||
lib/ansible/modules/packaging/os/pkgng.py
|
||||
lib/ansible/modules/packaging/os/pkgutil.py
|
||||
|
|
Loading…
Add table
Reference in a new issue