Add errors to ignore file, remove noqa directives

This commit is contained in:
beeankha 2020-08-26 11:55:13 -04:00
parent 4bc1a128ec
commit 3ddee3072b
8 changed files with 28 additions and 10 deletions

View File

@ -89,7 +89,7 @@ class InventoryModule(BaseInventoryPlugin):
if path.endswith('@tower_inventory'):
self.no_config_file_supplied = True
return True
elif super(InventoryModule, self).verify_file(path): # noqa
elif super(InventoryModule, self).verify_file(path):
return path.endswith(('tower_inventory.yml', 'tower_inventory.yaml', 'tower.yml', 'tower.yaml'))
else:
return False
@ -98,7 +98,7 @@ class InventoryModule(BaseInventoryPlugin):
self.display.warning(warning)
def parse(self, inventory, loader, path, cache=True):
super(InventoryModule, self).parse(inventory, loader, path) # noqa
super(InventoryModule, self).parse(inventory, loader, path)
if not self.no_config_file_supplied and os.path.isfile(path):
self._read_config_data(path)

View File

@ -28,7 +28,7 @@ class TowerAPIModule(TowerModule):
def __init__(self, argument_spec, direct_params=None, error_callback=None, warn_callback=None, **kwargs):
kwargs['supports_check_mode'] = True
super(TowerAPIModule, self).__init__(argument_spec=argument_spec, direct_params=direct_params, #noqa
super(TowerAPIModule, self).__init__(argument_spec=argument_spec, direct_params=direct_params,
error_callback=error_callback, warn_callback=warn_callback, **kwargs)
self.session = Request(cookies=CookieJar(), validate_certs=self.verify_ssl)

View File

@ -20,7 +20,7 @@ class TowerAWXKitModule(TowerModule):
def __init__(self, argument_spec, **kwargs):
kwargs['supports_check_mode'] = False
super(TowerAWXKitModule, self).__init__(argument_spec=argument_spec, **kwargs) # noqa
super(TowerAWXKitModule, self).__init__(argument_spec=argument_spec, **kwargs)
# Die if we don't have AWX_KIT installed
if not HAS_AWX_KIT:

View File

@ -110,7 +110,7 @@ class TowerLegacyModule(AnsibleModule):
('tower_config_file', 'validate_certs'),
))
super(TowerLegacyModule, self).__init__(argument_spec=args, **kwargs) # noqa
super(TowerLegacyModule, self).__init__(argument_spec=args, **kwargs)
if not HAS_TOWER_CLI:
self.fail_json(msg=missing_required_lib('ansible-tower-cli'),

View File

@ -71,7 +71,7 @@ class TowerModule(AnsibleModule):
if direct_params is not None:
self.params = direct_params
else:
super(TowerModule, self).__init__(argument_spec=full_argspec, **kwargs) # noqa
super(TowerModule, self).__init__(argument_spec=full_argspec, **kwargs)
self.load_config_files()
@ -225,15 +225,15 @@ class TowerModule(AnsibleModule):
if self.error_callback:
self.error_callback(**kwargs)
else:
super(TowerModule, self).fail_json(**kwargs) # noqa
super(TowerModule, self).fail_json(**kwargs)
def exit_json(self, **kwargs):
# Try to log out if we are authenticated
self.logout()
super(TowerModule, self).exit_json(**kwargs) # noqa
super(TowerModule, self).exit_json(**kwargs)
def warn(self, warning):
if self.warn_callback is not None:
self.warn_callback(warning)
else:
super(TowerModule, self).warn(warning) # noqa
super(TowerModule, self).warn(warning)

View File

@ -187,7 +187,7 @@ def run_module(request, collection_import):
try:
result = json.loads(module_stdout)
except Exception as e:
raise Exception('Module did not write valid JSON, error: {0}, stdout:\n{1}'.format(str(e), module_stdout)) # noqa
raise Exception('Module did not write valid JSON, error: {0}, stdout:\n{1}'.format(str(e), module_stdout))
# A module exception should never be a test expectation
if 'exception' in result:
if "ModuleNotFoundError: No module named 'tower_cli'" in result['exception']:

View File

@ -4,3 +4,12 @@ plugins/modules/tower_workflow_template.py validate-modules:deprecation-mismatch
plugins/modules/tower_credential.py pylint:wrong-collection-deprecated-version-tag
plugins/modules/tower_job_wait.py pylint:wrong-collection-deprecated-version-tag
plugins/modules/tower_notification.py pylint:wrong-collection-deprecated-version-tag
plugins/inventory/tower.py pylint:raise-missing-from
plugins/inventory/tower.py pylint:super-with-arguments
plugins/lookup/tower_schedule_rrule.py pylint:raise-missing-from
plugins/module_utils/tower_api.py pylint:super-with-arguments
plugins/module_utils/tower_awxkit.py pylint:super-with-arguments
plugins/module_utils/tower_legacy.py pylint:super-with-arguments
plugins/module_utils/tower_module.py pylint:super-with-arguments
plugins/module_utils/tower_module.py pylint:raise-missing-from
test/awx/conftest.py pylint:raise-missing-from

View File

@ -4,3 +4,12 @@ plugins/modules/tower_send.py validate-modules:deprecation-mismatch
plugins/modules/tower_send.py validate-modules:invalid-documentation
plugins/modules/tower_workflow_template.py validate-modules:deprecation-mismatch
plugins/modules/tower_workflow_template.py validate-modules:invalid-documentation
plugins/inventory/tower.py pylint:raise-missing-from
plugins/inventory/tower.py pylint:super-with-arguments
plugins/lookup/tower_schedule_rrule.py pylint:raise-missing-from
plugins/module_utils/tower_api.py pylint:super-with-arguments
plugins/module_utils/tower_awxkit.py pylint:super-with-arguments
plugins/module_utils/tower_legacy.py pylint:super-with-arguments
plugins/module_utils/tower_module.py pylint:super-with-arguments
plugins/module_utils/tower_module.py pylint:raise-missing-from
test/awx/conftest.py pylint:raise-missing-from