From dc2658046673a0dd5b05f602fd2cea803ac98022 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Mon, 19 Oct 2020 19:46:49 -0500 Subject: [PATCH] Update to response code set response code for current versions of tower/awx --- awx_collection/plugins/module_utils/tower_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx_collection/plugins/module_utils/tower_api.py b/awx_collection/plugins/module_utils/tower_api.py index cfda5b20ab..7439cbfb8f 100644 --- a/awx_collection/plugins/module_utils/tower_api.py +++ b/awx_collection/plugins/module_utils/tower_api.py @@ -438,8 +438,8 @@ class TowerAPIModule(TowerModule): response = self.post_endpoint(endpoint, **{'data': new_item}) - # 200 is response from approval node creation - if response['status_code'] == 201: + # 200 is response from approval node creation on tower 3.7.3 or awx 15.0.0 or earlier. + if response['status_code'] in [200, 201]: self.json_output['name'] = 'unknown' for key in ('name', 'username', 'identifier', 'hostname'): if key in response['json']: