Skip to content

Commit 187181b

Browse files
committed
fix dashboard file names
1 parent fcf60ca commit 187181b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contentctl/objects/dashboard.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ def pretty_print_json_obj(self):
104104
def getOutputFilepathRelativeToAppRoot(self, config: build) -> pathlib.Path:
105105
# for clarity, the name of the dashboard file will follow the same convention
106106
# as we use for detections, prefixing it with app_name -
107-
filename = f"{self.label(config)}.xml"
107+
if self.file_path is None:
108+
raise FileNotFoundError(
109+
f"Dashboard {self.name} file_path was None. Dashboards must be backed by a file."
110+
)
111+
filename = f"{self.file_path.stem}.xml"
108112
return pathlib.Path("default/data/ui/views") / filename
109113

110114
def writeDashboardFile(self, j2_env: Environment, config: build):

0 commit comments

Comments
 (0)