From a7caa14d3d8951cd83d3fe205e1b3e6aa26606f2 Mon Sep 17 00:00:00 2001 From: Richard Liaw Date: Tue, 15 Dec 2020 15:00:02 -0800 Subject: [PATCH] [k8s] avoid bad error messages (#12871) --- python/ray/autoscaler/_private/updater.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/ray/autoscaler/_private/updater.py b/python/ray/autoscaler/_private/updater.py index 0fbf84d94..8616fbe84 100644 --- a/python/ray/autoscaler/_private/updater.py +++ b/python/ray/autoscaler/_private/updater.py @@ -256,8 +256,16 @@ class NodeUpdater: retry_str = "(" + str(e) + ")" if hasattr(e, "cmd"): + if isinstance(e.cmd, str): + cmd_ = e.cmd + elif isinstance(e.cmd, list): + cmd_ = " ".join(e.cmd) + else: + logger.debug(f"e.cmd type ({type(e.cmd)}) not " + "list or str.") + cmd_ = str(e.cmd) retry_str = "(Exit Status {}): {}".format( - e.returncode, " ".join(e.cmd)) + e.returncode, cmd_) cli_logger.print( "SSH still not available {}, "