From b25c51f99aec110c35c29e39a952773a185de081 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Thu, 23 Feb 2017 08:05:59 -0500 Subject: [PATCH] cast http_port, https_port to int from config (#21840) When retrieving the http_port, https_port values from the configuration of the device, the values need to cast to int in order to correctly compare against the argspec values. This patch fixes that problem. fixes #21832 --- lib/ansible/modules/network/nxos/nxos_nxapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_nxapi.py b/lib/ansible/modules/network/nxos/nxos_nxapi.py index f40ecd7814..b66d0b4f64 100644 --- a/lib/ansible/modules/network/nxos/nxos_nxapi.py +++ b/lib/ansible/modules/network/nxos/nxos_nxapi.py @@ -192,14 +192,14 @@ def map_obj_to_commands(updates, module): def parse_http(data): match = re.search('HTTP Port:\s+(\d+)', data, re.M) if match: - return {'http': True, 'http_port': match.group(1)} + return {'http': True, 'http_port': int(match.group(1))} else: return {'http': False, 'http_port': None} def parse_https(data): match = re.search('HTTPS Port:\s+(\d+)', data, re.M) if match: - return {'https': True, 'https_port': match.group(1)} + return {'https': True, 'https_port': int(match.group(1))} else: return {'https': False, 'https_port': None}