mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-23 09:29:08 -07: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/'
|
origin: 'https://pkg.example.com/site/'
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
|
@ -145,11 +146,13 @@ def set_publisher(module, params):
|
||||||
'msg': err,
|
'msg': err,
|
||||||
'changed': True,
|
'changed': True,
|
||||||
}
|
}
|
||||||
|
if rc != 0:
|
||||||
|
module.fail_json(**response)
|
||||||
module.exit_json(**response)
|
module.exit_json(**response)
|
||||||
|
|
||||||
|
|
||||||
def unset_publisher(module, publisher):
|
def unset_publisher(module, publisher):
|
||||||
if not publisher in get_publishers(module):
|
if publisher not in get_publishers(module):
|
||||||
module.exit_json()
|
module.exit_json()
|
||||||
|
|
||||||
rc, out, err = module.run_command(
|
rc, out, err = module.run_command(
|
||||||
|
@ -162,6 +165,8 @@ def unset_publisher(module, publisher):
|
||||||
'msg': err,
|
'msg': err,
|
||||||
'changed': True,
|
'changed': True,
|
||||||
}
|
}
|
||||||
|
if rc != 0:
|
||||||
|
module.fail_json(**response)
|
||||||
module.exit_json(**response)
|
module.exit_json(**response)
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,7 +181,7 @@ def get_publishers(module):
|
||||||
values = dict(zip(keys, map(unstringify, line.split("\t"))))
|
values = dict(zip(keys, map(unstringify, line.split("\t"))))
|
||||||
name = values['publisher']
|
name = values['publisher']
|
||||||
|
|
||||||
if not name in publishers:
|
if name not in publishers:
|
||||||
publishers[name] = dict(
|
publishers[name] = dict(
|
||||||
(k, values[k]) for k in ['sticky', 'enabled']
|
(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/opkg.py
|
||||||
lib/ansible/modules/packaging/os/pacman.py
|
lib/ansible/modules/packaging/os/pacman.py
|
||||||
lib/ansible/modules/packaging/os/pkg5.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/pkgin.py
|
||||||
lib/ansible/modules/packaging/os/pkgng.py
|
lib/ansible/modules/packaging/os/pkgng.py
|
||||||
lib/ansible/modules/packaging/os/pkgutil.py
|
lib/ansible/modules/packaging/os/pkgutil.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue