Skip to content

Commit

Permalink
allow empty ip and token values, fixes #36
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Aug 6, 2017
1 parent 5af95d1 commit a69db2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mirobo/vacuum_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@


def validate_ip(ctx, param, value):
if value is None:
return value
try:
ipaddress.ip_address(value)
return value
Expand All @@ -29,6 +31,8 @@ def validate_ip(ctx, param, value):


def validate_token(ctx, param, value):
if value is None:
return value
token_len = len(value)
if token_len != 32:
raise click.BadParameter("Token length != 32 chars: %s" % token_len)
Expand Down

0 comments on commit a69db2d

Please sign in to comment.