mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Fix up ansible-test sanity checks due to ansible 2.17 release (#15208)
* Fix up ansible sanity checks * Fix awx-collection test failure * Add ignore for ansible-test 2.17 --------- Signed-off-by: Seth Foster <fosterbseth@gmail.com> Co-authored-by: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com>
This commit is contained in:
@@ -107,7 +107,7 @@ class ControllerModule(AnsibleModule):
|
|||||||
# Perform magic depending on whether controller_oauthtoken is a string or a dict
|
# Perform magic depending on whether controller_oauthtoken is a string or a dict
|
||||||
if self.params.get('controller_oauthtoken'):
|
if self.params.get('controller_oauthtoken'):
|
||||||
token_param = self.params.get('controller_oauthtoken')
|
token_param = self.params.get('controller_oauthtoken')
|
||||||
if type(token_param) is dict:
|
if isinstance(token_param, dict):
|
||||||
if 'token' in token_param:
|
if 'token' in token_param:
|
||||||
self.oauth_token = self.params.get('controller_oauthtoken')['token']
|
self.oauth_token = self.params.get('controller_oauthtoken')['token']
|
||||||
else:
|
else:
|
||||||
@@ -215,7 +215,7 @@ class ControllerModule(AnsibleModule):
|
|||||||
try:
|
try:
|
||||||
config_data = yaml.load(config_string, Loader=yaml.SafeLoader)
|
config_data = yaml.load(config_string, Loader=yaml.SafeLoader)
|
||||||
# If this is an actual ini file, yaml will return the whole thing as a string instead of a dict
|
# If this is an actual ini file, yaml will return the whole thing as a string instead of a dict
|
||||||
if type(config_data) is not dict:
|
if not isinstance(config_data, dict):
|
||||||
raise AssertionError("The yaml config file is not properly formatted as a dict.")
|
raise AssertionError("The yaml config file is not properly formatted as a dict.")
|
||||||
try_config_parsing = False
|
try_config_parsing = False
|
||||||
|
|
||||||
@@ -257,7 +257,7 @@ class ControllerModule(AnsibleModule):
|
|||||||
if honorred_setting in config_data:
|
if honorred_setting in config_data:
|
||||||
# Veriffy SSL must be a boolean
|
# Veriffy SSL must be a boolean
|
||||||
if honorred_setting == 'verify_ssl':
|
if honorred_setting == 'verify_ssl':
|
||||||
if type(config_data[honorred_setting]) is str:
|
if isinstance(config_data[honorred_setting], str):
|
||||||
setattr(self, honorred_setting, strtobool(config_data[honorred_setting]))
|
setattr(self, honorred_setting, strtobool(config_data[honorred_setting]))
|
||||||
else:
|
else:
|
||||||
setattr(self, honorred_setting, bool(config_data[honorred_setting]))
|
setattr(self, honorred_setting, bool(config_data[honorred_setting]))
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ def main():
|
|||||||
for arg in ['job_type', 'limit', 'forks', 'verbosity', 'extra_vars', 'become_enabled', 'diff_mode']:
|
for arg in ['job_type', 'limit', 'forks', 'verbosity', 'extra_vars', 'become_enabled', 'diff_mode']:
|
||||||
if module.params.get(arg):
|
if module.params.get(arg):
|
||||||
# extra_var can receive a dict or a string, if a dict covert it to a string
|
# extra_var can receive a dict or a string, if a dict covert it to a string
|
||||||
if arg == 'extra_vars' and type(module.params.get(arg)) is not str:
|
if arg == 'extra_vars' and not isinstance(module.params.get(arg), str):
|
||||||
post_data[arg] = json.dumps(module.params.get(arg))
|
post_data[arg] = json.dumps(module.params.get(arg))
|
||||||
else:
|
else:
|
||||||
post_data[arg] = module.params.get(arg)
|
post_data[arg] = module.params.get(arg)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import logging
|
|||||||
|
|
||||||
# In this module we don't use EXPORTABLE_RESOURCES, we just want to validate that our installed awxkit has import/export
|
# In this module we don't use EXPORTABLE_RESOURCES, we just want to validate that our installed awxkit has import/export
|
||||||
try:
|
try:
|
||||||
from awxkit.api.pages.api import EXPORTABLE_RESOURCES # noqa
|
from awxkit.api.pages.api import EXPORTABLE_RESOURCES # noqa: F401; pylint: disable=unused-import
|
||||||
|
|
||||||
HAS_EXPORTABLE_RESOURCES = True
|
HAS_EXPORTABLE_RESOURCES = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from ansible.module_utils.six import raise_from
|
|||||||
|
|
||||||
from ansible_base.rbac.models import RoleDefinition, DABPermission
|
from ansible_base.rbac.models import RoleDefinition, DABPermission
|
||||||
from awx.main.tests.functional.conftest import _request
|
from awx.main.tests.functional.conftest import _request
|
||||||
from awx.main.tests.functional.conftest import credentialtype_scm, credentialtype_ssh # noqa: F401; pylint: disable=unused-variable
|
from awx.main.tests.functional.conftest import credentialtype_scm, credentialtype_ssh # noqa: F401; pylint: disable=unused-import
|
||||||
from awx.main.models import (
|
from awx.main.models import (
|
||||||
Organization,
|
Organization,
|
||||||
Project,
|
Project,
|
||||||
|
|||||||
1
awx_collection/tests/sanity/ignore-2.17.txt
Normal file
1
awx_collection/tests/sanity/ignore-2.17.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
plugins/modules/export.py validate-modules:nonexistent-parameter-documented # needs awxkit to construct argspec
|
||||||
Reference in New Issue
Block a user