From c8c5d6f8848d0d847dbf5ad9184b3a5d982a96ed Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Tue, 9 Apr 2019 16:25:45 -0400 Subject: [PATCH] Allow the zk_conn to be none properly --- client-cli/pvc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)