File tree Expand file tree Collapse file tree 4 files changed +12
-17
lines changed
storage/src/simcore_service_storage Expand file tree Collapse file tree 4 files changed +12
-17
lines changed Original file line number Diff line number Diff line change 1111 ValuesView ,
1212)
1313
14- from pydantic import validator
1514from pydantic .generics import GenericModel
1615
1716DictKey = TypeVar ("DictKey" )
@@ -65,12 +64,3 @@ def __len__(self):
6564class Envelope (GenericModel , Generic [DataT ]):
6665 data : Optional [DataT ]
6766 error : Optional [Any ]
68-
69- @validator ("error" )
70- @classmethod
71- def data_and_error_cannot_be_populated_together (cls , v , values ):
72- if v is not None and values .get ("data" ) is not None :
73- raise ValueError (
74- "both data and error cannot contain values at the same time"
75- )
76- return v
Original file line number Diff line number Diff line change @@ -56,6 +56,3 @@ def test_data_enveloped(faker: Faker):
5656 assert some_enveloped_bool
5757 assert not some_enveloped_bool .data
5858 assert some_enveloped_bool .error == random_text
59-
60- with pytest .raises (ValueError ):
61- Envelope [int ](data = 213 , error = "some error message" )
Original file line number Diff line number Diff line change 3636if [ " ${SC_BOOT_MODE} " = " debug-ptvsd" ]; then
3737 # NOTE: ptvsd is programmatically enabled inside of the service
3838 # this way we can have reload in place as well
39+ reload_dir_packages=$( find packages -maxdepth 3 -type d -path " */src/*" ! -path " *.*" -exec echo --reload-dir {} \; )
40+
41+ # NOTE: keep the reload_dir_package as un-quoted as the IFS (internal field separators works only this way. any SH shell guru is welcome to enhance this!
42+ # FIXME: when uvicorn >0.15.0 comes in, replace it with --reload-include '*.py'
43+ IFS=$( printf ' \n\t' ) ;
44+ # shellcheck disable=SC2086
3945 exec uvicorn simcore_service_director_v2.main:the_app \
40- --reload \
4146 --host 0.0.0.0 \
42- --reload-dir services/director-v2/src/simcore_service_director_v2 \
43- --reload-dir packages
47+ --reload \
48+ $reload_dir_packages \
49+ --reload-dir services/director-v2/src/simcore_service_director_v2
4450else
4551 exec uvicorn simcore_service_director_v2.main:the_app \
4652 --host 0.0.0.0
Original file line number Diff line number Diff line change @@ -214,7 +214,9 @@ async def get_file_metadata(request: web.Request):
214214 )
215215 # when no metadata is found
216216 if data is None :
217- return {"error" : "No result found" }
217+ # NOTE: This is what happens Larry... data must be an empty {} or else some old
218+ # dynamic services will FAIL (sic)
219+ return {"error" : "No result found" , "data" : {}}
218220
219221 return {
220222 "error" : None ,
You can’t perform that action at this time.
0 commit comments