From e25b55f6ed90923cbad20901c0688586eea023f8 Mon Sep 17 00:00:00 2001 From: shoulinwei Date: Sun, 1 Aug 2021 21:53:09 +0800 Subject: [PATCH] level1 file --- csst_dfs_api_cluster/ifs/level1.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/csst_dfs_api_cluster/ifs/level1.py b/csst_dfs_api_cluster/ifs/level1.py index 3fb2542..09d67f5 100644 --- a/csst_dfs_api_cluster/ifs/level1.py +++ b/csst_dfs_api_cluster/ifs/level1.py @@ -170,8 +170,12 @@ class Level1DataApi(object): yield level1_pb2.WriteLevel1Req(record = rec, data = data) try: + if not rec.file_path: + return Result.error(message="file_path is blank") if not os.path.exists(rec.file_path): return Result.error(message="the file [%s] not existed" % (rec.file_path, )) + if not rec.filename: + rec.filename = os.path.basename(rec.file_path) resp,_ = self.stub.Write.with_call(stream(rec),metadata = get_auth_headers()) if resp.success: -- GitLab