[hostlist] Add port value validation
When in console, and adding a new host with an invalid port number, the console starts printing many exceptions regarding the value. Therefor, we will make sure that the port value is between 0 and 65535.
This commit is contained in:
parent
7af584d649
commit
38feea0fa4
|
@ -50,6 +50,8 @@ def validate_host_info(hostname, port):
|
||||||
|
|
||||||
if not isinstance(port, int):
|
if not isinstance(port, int):
|
||||||
raise ValueError('Invalid port. Must be an integer')
|
raise ValueError('Invalid port. Must be an integer')
|
||||||
|
if not 0 <= port <= 65535:
|
||||||
|
raise ValueError('Invalid port. Must be between 0-65535')
|
||||||
|
|
||||||
|
|
||||||
def migrate_hostlist(old_filename, new_filename):
|
def migrate_hostlist(old_filename, new_filename):
|
||||||
|
|
Loading…
Reference in New Issue