mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Enable additional pylint rules and resolve issues found. (#47221)
* Resolve unneeded-not. * Resolve global-at-module-level. * Resolve useless-import-alias. * Resolve bad-whitespace. * Resolve global-variable-not-assigned. * Resolve logging-not-lazy. * Resolve comparison-with-itself.
This commit is contained in:
@@ -69,7 +69,7 @@ def check_aos_version(module, min=False):
|
||||
import apstra.aosom
|
||||
AOS_PYEZ_VERSION = apstra.aosom.__version__
|
||||
|
||||
if not LooseVersion(AOS_PYEZ_VERSION) >= LooseVersion(min):
|
||||
if LooseVersion(AOS_PYEZ_VERSION) < LooseVersion(min):
|
||||
module.fail_json(msg='aos-pyez >= %s is required for this module' % min)
|
||||
|
||||
return True
|
||||
|
||||
@@ -129,7 +129,7 @@ def load_configuration(module, candidate=None, action='merge', rollback=None, fo
|
||||
module.fail_json(msg='invalid action for format json')
|
||||
elif format in ('text', 'xml') and action not in ACTIONS:
|
||||
module.fail_json(msg='invalid action format %s' % format)
|
||||
if action == 'set' and not format == 'text':
|
||||
if action == 'set' and format != 'text':
|
||||
module.fail_json(msg='format must be text when action is set')
|
||||
|
||||
conn = get_connection(module)
|
||||
|
||||
Reference in New Issue
Block a user