From 228c1fe930d521b71f8bff2778a6c333ff93ad25 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 20 Oct 2022 16:06:59 +0800 Subject: [PATCH] fix parsing when the manifest dir is empty --- src/fidesctl/ctl/core/parse.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fidesctl/ctl/core/parse.py b/src/fidesctl/ctl/core/parse.py index 6d8a3cf7b2..5dcd83d99a 100644 --- a/src/fidesctl/ctl/core/parse.py +++ b/src/fidesctl/ctl/core/parse.py @@ -3,7 +3,7 @@ from fideslang.manifests import ingest_manifests from fideslang.parse import load_manifests_into_taxonomy -from fidesctl.ctl.core.utils import echo_green +from fidesctl.ctl.core.utils import echo_green, get_manifest_list def parse(manifests_dir: str) -> Taxonomy: @@ -11,7 +11,11 @@ def parse(manifests_dir: str) -> Taxonomy: Parse local manifest file(s) into a Taxonomy. """ + # Check if any manifests exist before trying to parse them print(f"Loading resource manifests from: {manifests_dir}") + if not get_manifest_list(manifests_dir): + print("No manifests found to parse, skipping...") + return Taxonomy() ingested_manifests = ingest_manifests(manifests_dir) taxonomy = load_manifests_into_taxonomy(ingested_manifests) echo_green("Taxonomy successfully created.")