mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 15:02:07 -03:30
standardizing how host gets validated (#16003)
* removing the requirement for re and changing to startswith which the other AAP collections use * telling sonarqube to ignore this line * fixing lint error
This commit is contained in:
parent
9520c83da9
commit
a655a3f127
@ -15,7 +15,6 @@ from ansible.module_utils.six.moves.configparser import ConfigParser, NoOptionEr
|
||||
from base64 import b64encode
|
||||
from socket import getaddrinfo, IPPROTO_TCP
|
||||
import time
|
||||
import re
|
||||
from json import loads, dumps
|
||||
from os.path import isfile, expanduser, split, join, exists, isdir
|
||||
from os import access, R_OK, getcwd, environ, getenv
|
||||
@ -106,7 +105,7 @@ class ControllerModule(AnsibleModule):
|
||||
setattr(self, short_param, direct_value)
|
||||
|
||||
# Perform some basic validation
|
||||
if not re.match('^https{0,1}://', self.host):
|
||||
if not self.host.startswith(("https://", "http://")): # NOSONAR
|
||||
self.host = "https://{0}".format(self.host)
|
||||
|
||||
# Try to parse the hostname as a url
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user