mirror of
https://github.com/logos-storage/deluge.git
synced 2026-01-03 05:33:12 +00:00
[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):
|
||||
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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user