valid port type before compare to min and max value
This commit is contained in:
parent
e7531e1fda
commit
8d751ecc9b
@ -852,12 +852,13 @@ class PortOption(Option):
|
||||
|
||||
for val in value:
|
||||
try:
|
||||
if not self._min_value <= int(val) <= self._max_value:
|
||||
raise ValueError(_('invalid port, must be an between {0} '
|
||||
'and {1}').format(self._min_value,
|
||||
self._max_value))
|
||||
int(val)
|
||||
except ValueError:
|
||||
raise ValueError(_('invalid port'))
|
||||
if not self._min_value <= int(val) <= self._max_value:
|
||||
raise ValueError(_('invalid port, must be an between {0} '
|
||||
'and {1}').format(self._min_value,
|
||||
self._max_value))
|
||||
|
||||
|
||||
class NetworkOption(Option):
|
||||
|
Loading…
Reference in New Issue
Block a user