From ac39f88aa15b511dab1230720057b9737d38c102 Mon Sep 17 00:00:00 2001 From: Hong Guan Date: Thu, 11 Oct 2018 13:53:51 -0400 Subject: [PATCH] Enhance the helm plugin error message Change-Id: I872b799142b1bb7fe7f1f546646fa4fb325f7698 Issue-ID: CCSDK-619 Signed-off-by: Hong Guan --- helm/plugin/tasks.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/helm/plugin/tasks.py b/helm/plugin/tasks.py index 4ffcd81..3374e94 100644 --- a/helm/plugin/tasks.py +++ b/helm/plugin/tasks.py @@ -48,9 +48,12 @@ def execute_command(_command): } ctx.logger.debug('subprocess_args {0}.'.format(subprocess_args)) - - process = subprocess.Popen(**subprocess_args) - output, error = process.communicate() + try: + process = subprocess.Popen(**subprocess_args) + output, error = process.communicate() + except Exception as e: + ctx.logger.debug(str(e)) + return False ctx.logger.debug('command: {0} '.format(_command)) ctx.logger.debug('output: {0} '.format(output)) -- 2.16.6