mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
PEP 8 cleanup. (#20789)
* PEP 8 E703 cleanup. * PEP 8 E701 cleanup. * PEP 8 E711 cleanup. * PEP 8 W191 and E101 cleanup.
This commit is contained in:
parent
c29d1e3162
commit
d0d1158c5e
72 changed files with 184 additions and 174 deletions
|
@ -111,7 +111,7 @@ def modify_publisher(module, params):
|
|||
|
||||
if name in existing:
|
||||
for option in ['origin', 'mirror', 'sticky', 'enabled']:
|
||||
if params[option] != None:
|
||||
if params[option] is not None:
|
||||
if params[option] != existing[name][option]:
|
||||
return set_publisher(module, params)
|
||||
else:
|
||||
|
@ -124,21 +124,21 @@ def set_publisher(module, params):
|
|||
name = params['name']
|
||||
args = []
|
||||
|
||||
if params['origin'] != None:
|
||||
if params['origin'] is not None:
|
||||
args.append('--remove-origin=*')
|
||||
args.extend(['--add-origin=' + u for u in params['origin']])
|
||||
if params['mirror'] != None:
|
||||
if params['mirror'] is not None:
|
||||
args.append('--remove-mirror=*')
|
||||
args.extend(['--add-mirror=' + u for u in params['mirror']])
|
||||
|
||||
if params['sticky'] != None and params['sticky']:
|
||||
if params['sticky'] is not None and params['sticky']:
|
||||
args.append('--sticky')
|
||||
elif params['sticky'] != None:
|
||||
elif params['sticky'] is not None:
|
||||
args.append('--non-sticky')
|
||||
|
||||
if params['enabled'] != None and params['enabled']:
|
||||
if params['enabled'] is not None and params['enabled']:
|
||||
args.append('--enable')
|
||||
elif params['enabled'] != None:
|
||||
elif params['enabled'] is not None:
|
||||
args.append('--disable')
|
||||
|
||||
rc, out, err = module.run_command(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue