From 5bef920601c064e7309ed14fcee5ddde70d9fa22 Mon Sep 17 00:00:00 2001 From: Sergey Serebryakov Date: Fri, 18 Aug 2023 07:34:23 -0700 Subject: [PATCH] Fixing CLI commands fail when `mount` option not present. (#341) The parser checks if certain CLI arguments present before accessing them. One of previous commits that introduced new `mount` options was not checking for this, and was accessing mount option directly. That was causing no such key error. This commit fixes it. --- mlcube/mlcube/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlcube/mlcube/parser.py b/mlcube/mlcube/parser.py index 08aa76c..17ee426 100644 --- a/mlcube/mlcube/parser.py +++ b/mlcube/mlcube/parser.py @@ -139,7 +139,8 @@ def parse_extra_arg( if parsed_args.get("cpu", None): key = "--cpuset-cpus" if platform == "docker" else "--vm-cpu" runner_run_args[key] = parsed_args["cpu"] - runner_run_args["--mount_opts"] = parsed_args["mount"] + if parsed_args.get("mount", None): + runner_run_args["--mount_opts"] = parsed_args["mount"] mlcube_args.merge_with({platform: runner_run_args})