mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-22 20:58:28 +00:00
Assure we can call get_spec and it can return the master spec correctly.
This commit is contained in:
parent
a047c63c32
commit
1858cd314f
@ -62,7 +62,7 @@ class SpecFileService(FileSystemService):
|
||||
if os.path.exists(file_path):
|
||||
break
|
||||
if not os.path.exists(file_path):
|
||||
raise ApiError("unknown_file", f"So file found with name {file_name} in {workflow_spec.display_name}")
|
||||
raise ApiError("unknown_file", f"No file found with name {file_name} in {workflow_spec.display_name}")
|
||||
with open(file_path, 'rb') as f_handle:
|
||||
spec_file_data = f_handle.read()
|
||||
return spec_file_data
|
||||
|
@ -60,8 +60,10 @@ class WorkflowSpecService(FileSystemService):
|
||||
def get_spec(self, spec_id):
|
||||
if not os.path.exists(FileSystemService.root_path()):
|
||||
return # Nothing to scan yet. There are no files.
|
||||
if spec_id == 'master_spec':
|
||||
return self.get_master_spec()
|
||||
|
||||
master_spec = self.get_master_spec()
|
||||
if master_spec.id == spec_id:
|
||||
return master_spec
|
||||
with os.scandir(FileSystemService.root_path()) as category_dirs:
|
||||
for item in category_dirs:
|
||||
category_dir = item
|
||||
|
Loading…
x
Reference in New Issue
Block a user