diff --git a/client-cli/pvc.py b/client-cli/pvc.py index fa7a06da..f2603f56 100755 --- a/client-cli/pvc.py +++ b/client-cli/pvc.py @@ -42,8 +42,9 @@ zk_host = '' CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'], max_content_width=120) -def cleanup(retcode, retmsg, zk_conn): - pvc_common.stopZKConnection(zk_conn) +def cleanup(retcode, retmsg, zk_conn=None): + if zk_conn: + pvc_common.stopZKConnection(zk_conn) if retcode == True: if retmsg != '': click.echo(retmsg)