From b1119d2972d3a10db6b9f16c04785f7af3212c9c Mon Sep 17 00:00:00 2001 From: beeankha Date: Mon, 29 Mar 2021 16:11:06 -0400 Subject: [PATCH] Fix format specification linting erros --- awx_collection/plugins/module_utils/tower_api.py | 4 ++-- awx_collection/test/awx/test_module_utils.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/awx_collection/plugins/module_utils/tower_api.py b/awx_collection/plugins/module_utils/tower_api.py index f6c63b08de..c637f0f7b7 100644 --- a/awx_collection/plugins/module_utils/tower_api.py +++ b/awx_collection/plugins/module_utils/tower_api.py @@ -266,8 +266,8 @@ class TowerAPIModule(TowerModule): collection_compare_ver = parsed_collection_version[0] tower_compare_ver = parsed_tower_version[0] else: - collection_compare_ver = "{}.{}".format(parsed_collection_version[0], parsed_collection_version[1]) - tower_compare_ver = '{}.{}'.format(parsed_tower_version[0], parsed_tower_version[1]) + collection_compare_ver = "{0}.{1}".format(parsed_collection_version[0], parsed_collection_version[1]) + tower_compare_ver = '{0}.{1}'.format(parsed_tower_version[0], parsed_tower_version[1]) if self._COLLECTION_TYPE not in self.collection_to_version or self.collection_to_version[self._COLLECTION_TYPE] != tower_type: self.warn("You are using the {0} version of this collection but connecting to {1}".format(self._COLLECTION_TYPE, tower_type)) diff --git a/awx_collection/test/awx/test_module_utils.py b/awx_collection/test/awx/test_module_utils.py index 89bd44154e..a215db35fc 100644 --- a/awx_collection/test/awx/test_module_utils.py +++ b/awx_collection/test/awx/test_module_utils.py @@ -59,7 +59,7 @@ def test_version_warning(collection_import, silence_warning): my_module._COLLECTION_TYPE = "awx" my_module.get_endpoint('ping') silence_warning.assert_called_once_with( - 'You are running collection version {} but connecting to {} version {}'.format(my_module._COLLECTION_VERSION, awx_name, ping_version) + 'You are running collection version {0} but connecting to {1} version {2}'.format(my_module._COLLECTION_VERSION, awx_name, ping_version) ) @@ -107,7 +107,7 @@ def test_version_warning_strictness_tower(collection_import, silence_warning): my_module._COLLECTION_TYPE = "tower" my_module.get_endpoint('ping') silence_warning.assert_called_once_with( - 'You are running collection version {} but connecting to {} version {}'.format(my_module._COLLECTION_VERSION, tower_name, ping_version) + 'You are running collection version {0} but connecting to {1} version {2}'.format(my_module._COLLECTION_VERSION, tower_name, ping_version) ) @@ -121,7 +121,9 @@ def test_type_warning(collection_import, silence_warning): my_module._COLLECTION_VERSION = ping_version my_module._COLLECTION_TYPE = "tower" my_module.get_endpoint('ping') - silence_warning.assert_called_once_with('You are using the {} version of this collection but connecting to {}'.format(my_module._COLLECTION_TYPE, awx_name)) + silence_warning.assert_called_once_with( + 'You are using the {0} version of this collection but connecting to {1}'.format(my_module._COLLECTION_TYPE, awx_name) + ) def test_duplicate_config(collection_import, silence_warning):