mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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
This commit is contained in:
parent
ab0f992b3a
commit
b25c51f99a
1 changed files with 2 additions and 2 deletions
|
@ -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}
|
||||
|
||||
|
|
Loading…
Reference in a new issue