NSX|V3 Validate rate-limit value in admin utilitiy

Change-Id: Id516e068cec06973fe670a2956d762b26ace7e6a
This commit is contained in:
Adit Sarfaty 2018-08-30 09:14:12 +03:00
parent 494356cb1c
commit ec9c7465bc

View File

@ -55,7 +55,7 @@ def nsx_rate_limit_update(resource, event, trigger, **kwargs):
if kwargs.get('property'):
properties = admin_utils.parse_multi_keyval_opt(kwargs['property'])
rate_limit = properties.get('value', None)
if rate_limit is None:
if rate_limit is None or not rate_limit.isdigit():
usage = ("nsxadmin -r rate-limit -o nsx-update "
"--property value=<new limit>")
LOG.error("Missing parameters. Usage: %s", usage)