From a1613cee4ef5d2e04595cc46533d9e9086310260 Mon Sep 17 00:00:00 2001 From: chesterxgchen Date: Fri, 19 Jan 2024 15:00:12 -0800 Subject: [PATCH 1/2] check invalid input directory --- nvflare/cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nvflare/cli.py b/nvflare/cli.py index 316973f8ba..15a90a1a70 100644 --- a/nvflare/cli.py +++ b/nvflare/cli.py @@ -115,6 +115,8 @@ def def_config_parser(sub_cmd): def handle_config_cmd(args): config_file_path, nvflare_config = get_hidden_config() + if not args.poc_workspace_dir or not os.path.isdir(args.job_templates_dir): + raise ValueError(f"job_templates_dir='{args.job_templates_dir}', it is not a directory") nvflare_config = create_startup_kit_config(nvflare_config, args.startup_kit_dir) nvflare_config = create_poc_workspace_config(nvflare_config, args.poc_workspace_dir) From 9f661f2712cb801b2de9671764795cc3a091e471 Mon Sep 17 00:00:00 2001 From: chesterxgchen Date: Fri, 19 Jan 2024 15:20:44 -0800 Subject: [PATCH 2/2] check invalid input directory --- nvflare/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nvflare/cli.py b/nvflare/cli.py index 15a90a1a70..eee979f7a7 100644 --- a/nvflare/cli.py +++ b/nvflare/cli.py @@ -115,7 +115,8 @@ def def_config_parser(sub_cmd): def handle_config_cmd(args): config_file_path, nvflare_config = get_hidden_config() - if not args.poc_workspace_dir or not os.path.isdir(args.job_templates_dir): + + if not args.job_templates_dir or not os.path.isdir(args.job_templates_dir): raise ValueError(f"job_templates_dir='{args.job_templates_dir}', it is not a directory") nvflare_config = create_startup_kit_config(nvflare_config, args.startup_kit_dir)