From a69db2dc839c8d037350dde639e3c03bdde07257 Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Sun, 6 Aug 2017 16:08:20 +0200 Subject: [PATCH] allow empty ip and token values, fixes #36 --- mirobo/vacuum_cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mirobo/vacuum_cli.py b/mirobo/vacuum_cli.py index 6414fa20e..244455c94 100644 --- a/mirobo/vacuum_cli.py +++ b/mirobo/vacuum_cli.py @@ -21,6 +21,8 @@ def validate_ip(ctx, param, value): + if value is None: + return value try: ipaddress.ip_address(value) return value @@ -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)