Skip to content

Commit 0d4f653

Browse files
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 <[email protected]> Co-authored-by: Hao Liu <[email protected]>
1 parent 8de8f6d commit 0d4f653

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

awx_collection/plugins/module_utils/controller_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(self, argument_spec=None, direct_params=None, error_callback=None,
107107
# Perform magic depending on whether controller_oauthtoken is a string or a dict
108108
if self.params.get('controller_oauthtoken'):
109109
token_param = self.params.get('controller_oauthtoken')
110-
if type(token_param) is dict:
110+
if isinstance(token_param, dict):
111111
if 'token' in token_param:
112112
self.oauth_token = self.params.get('controller_oauthtoken')['token']
113113
else:
@@ -215,7 +215,7 @@ def load_config(self, config_path):
215215
try:
216216
config_data = yaml.load(config_string, Loader=yaml.SafeLoader)
217217
# If this is an actual ini file, yaml will return the whole thing as a string instead of a dict
218-
if type(config_data) is not dict:
218+
if not isinstance(config_data, dict):
219219
raise AssertionError("The yaml config file is not properly formatted as a dict.")
220220
try_config_parsing = False
221221

@@ -257,7 +257,7 @@ def load_config(self, config_path):
257257
if honorred_setting in config_data:
258258
# Veriffy SSL must be a boolean
259259
if honorred_setting == 'verify_ssl':
260-
if type(config_data[honorred_setting]) is str:
260+
if isinstance(config_data[honorred_setting], str):
261261
setattr(self, honorred_setting, strtobool(config_data[honorred_setting]))
262262
else:
263263
setattr(self, honorred_setting, bool(config_data[honorred_setting]))

awx_collection/plugins/modules/ad_hoc_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def main():
163163
for arg in ['job_type', 'limit', 'forks', 'verbosity', 'extra_vars', 'become_enabled', 'diff_mode']:
164164
if module.params.get(arg):
165165
# extra_var can receive a dict or a string, if a dict covert it to a string
166-
if arg == 'extra_vars' and type(module.params.get(arg)) is not str:
166+
if arg == 'extra_vars' and not isinstance(module.params.get(arg), str):
167167
post_data[arg] = json.dumps(module.params.get(arg))
168168
else:
169169
post_data[arg] = module.params.get(arg)

awx_collection/plugins/modules/import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
# In this module we don't use EXPORTABLE_RESOURCES, we just want to validate that our installed awxkit has import/export
5858
try:
59-
from awxkit.api.pages.api import EXPORTABLE_RESOURCES # noqa
59+
from awxkit.api.pages.api import EXPORTABLE_RESOURCES # noqa: F401; pylint: disable=unused-import
6060

6161
HAS_EXPORTABLE_RESOURCES = True
6262
except ImportError:

awx_collection/test/awx/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from ansible_base.rbac.models import RoleDefinition, DABPermission
2121
from awx.main.tests.functional.conftest import _request
22-
from awx.main.tests.functional.conftest import credentialtype_scm, credentialtype_ssh # noqa: F401; pylint: disable=unused-variable
22+
from awx.main.tests.functional.conftest import credentialtype_scm, credentialtype_ssh # noqa: F401; pylint: disable=unused-import
2323
from awx.main.models import (
2424
Organization,
2525
Project,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plugins/modules/export.py validate-modules:nonexistent-parameter-documented # needs awxkit to construct argspec

0 commit comments

Comments
 (0)