Using 'is_valid_ipaddress' utility function everywhere

This commit is contained in:
Ashesh Vashi 2020-04-14 18:51:48 +05:30
parent d9c84edf9a
commit 3a4641889c

View File

@ -523,8 +523,7 @@ class ServerNode(PGChildNodeView):
data['db_res'] = ','.join(data['db_res'])
if 'hostaddr' in data and data['hostaddr'] and data['hostaddr'] != '':
if not self.pat4.match(data['hostaddr']):
if not self.pat6.match(data['hostaddr']):
if not is_valid_ipaddress(data['hostaddr']):
return make_json_response(
success=0,
status=400,