mirror of
https://github.com/ansible/awx.git
synced 2026-02-13 10:44:58 -03:30
Add noqa directive for super calls
This commit is contained in:
@@ -89,7 +89,7 @@ class InventoryModule(BaseInventoryPlugin):
|
|||||||
if path.endswith('@tower_inventory'):
|
if path.endswith('@tower_inventory'):
|
||||||
self.no_config_file_supplied = True
|
self.no_config_file_supplied = True
|
||||||
return True
|
return True
|
||||||
elif super().verify_file(path):
|
elif super(InventoryModule, self).verify_file(path): # noqa
|
||||||
return path.endswith(('tower_inventory.yml', 'tower_inventory.yaml', 'tower.yml', 'tower.yaml'))
|
return path.endswith(('tower_inventory.yml', 'tower_inventory.yaml', 'tower.yml', 'tower.yaml'))
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
@@ -98,7 +98,7 @@ class InventoryModule(BaseInventoryPlugin):
|
|||||||
self.display.warning(warning)
|
self.display.warning(warning)
|
||||||
|
|
||||||
def parse(self, inventory, loader, path, cache=True):
|
def parse(self, inventory, loader, path, cache=True):
|
||||||
super().parse(inventory, loader, path)
|
super(InventoryModule, self).parse(inventory, loader, path) # noqa
|
||||||
if not self.no_config_file_supplied and os.path.isfile(path):
|
if not self.no_config_file_supplied and os.path.isfile(path):
|
||||||
self._read_config_data(path)
|
self._read_config_data(path)
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ class TowerAPIModule(TowerModule):
|
|||||||
def __init__(self, argument_spec, direct_params=None, error_callback=None, warn_callback=None, **kwargs):
|
def __init__(self, argument_spec, direct_params=None, error_callback=None, warn_callback=None, **kwargs):
|
||||||
kwargs['supports_check_mode'] = True
|
kwargs['supports_check_mode'] = True
|
||||||
|
|
||||||
super().__init__(argument_spec=argument_spec, direct_params=direct_params,
|
super(TowerAPIModule, self).__init__(argument_spec=argument_spec, direct_params=direct_params, #noqa
|
||||||
error_callback=error_callback, warn_callback=warn_callback, **kwargs)
|
error_callback=error_callback, warn_callback=warn_callback, **kwargs)
|
||||||
self.session = Request(cookies=CookieJar(), validate_certs=self.verify_ssl)
|
self.session = Request(cookies=CookieJar(), validate_certs=self.verify_ssl)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class TowerAWXKitModule(TowerModule):
|
|||||||
def __init__(self, argument_spec, **kwargs):
|
def __init__(self, argument_spec, **kwargs):
|
||||||
kwargs['supports_check_mode'] = False
|
kwargs['supports_check_mode'] = False
|
||||||
|
|
||||||
super().__init__(argument_spec=argument_spec, **kwargs)
|
super(TowerAWXKitModule, self).__init__(argument_spec=argument_spec, **kwargs) # noqa
|
||||||
|
|
||||||
# Die if we don't have AWX_KIT installed
|
# Die if we don't have AWX_KIT installed
|
||||||
if not HAS_AWX_KIT:
|
if not HAS_AWX_KIT:
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class TowerLegacyModule(AnsibleModule):
|
|||||||
('tower_config_file', 'validate_certs'),
|
('tower_config_file', 'validate_certs'),
|
||||||
))
|
))
|
||||||
|
|
||||||
super().__init__(argument_spec=args, **kwargs)
|
super(TowerLegacyModule, self).__init__(argument_spec=args, **kwargs) # noqa
|
||||||
|
|
||||||
if not HAS_TOWER_CLI:
|
if not HAS_TOWER_CLI:
|
||||||
self.fail_json(msg=missing_required_lib('ansible-tower-cli'),
|
self.fail_json(msg=missing_required_lib('ansible-tower-cli'),
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class TowerModule(AnsibleModule):
|
|||||||
if direct_params is not None:
|
if direct_params is not None:
|
||||||
self.params = direct_params
|
self.params = direct_params
|
||||||
else:
|
else:
|
||||||
super().__init__(argument_spec=full_argspec, **kwargs)
|
super(TowerModule, self).__init__(argument_spec=full_argspec, **kwargs) # noqa
|
||||||
|
|
||||||
self.load_config_files()
|
self.load_config_files()
|
||||||
|
|
||||||
@@ -225,15 +225,15 @@ class TowerModule(AnsibleModule):
|
|||||||
if self.error_callback:
|
if self.error_callback:
|
||||||
self.error_callback(**kwargs)
|
self.error_callback(**kwargs)
|
||||||
else:
|
else:
|
||||||
super().fail_json(**kwargs)
|
super(TowerModule, self).fail_json(**kwargs) # noqa
|
||||||
|
|
||||||
def exit_json(self, **kwargs):
|
def exit_json(self, **kwargs):
|
||||||
# Try to log out if we are authenticated
|
# Try to log out if we are authenticated
|
||||||
self.logout()
|
self.logout()
|
||||||
super().exit_json(**kwargs)
|
super(TowerModule, self).exit_json(**kwargs) # noqa
|
||||||
|
|
||||||
def warn(self, warning):
|
def warn(self, warning):
|
||||||
if self.warn_callback is not None:
|
if self.warn_callback is not None:
|
||||||
self.warn_callback(warning)
|
self.warn_callback(warning)
|
||||||
else:
|
else:
|
||||||
super().warn(warning)
|
super(TowerModule, self).warn(warning) # noqa
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ def run_module(request, collection_import):
|
|||||||
try:
|
try:
|
||||||
result = json.loads(module_stdout)
|
result = json.loads(module_stdout)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
module.fail_json(msg='Module did not write valid JSON, error: {0}, stdout:\n{1}'.format(str(e), module_stdout))
|
raise Exception('Module did not write valid JSON, error: {0}, stdout:\n{1}'.format(str(e), module_stdout)) # noqa
|
||||||
# A module exception should never be a test expectation
|
# A module exception should never be a test expectation
|
||||||
if 'exception' in result:
|
if 'exception' in result:
|
||||||
if "ModuleNotFoundError: No module named 'tower_cli'" in result['exception']:
|
if "ModuleNotFoundError: No module named 'tower_cli'" in result['exception']:
|
||||||
|
|||||||
Reference in New Issue
Block a user