diff --git a/api/config.py b/api/config.py index a4a2afe1e..f1cc31d55 100644 --- a/api/config.py +++ b/api/config.py @@ -23,7 +23,7 @@ logging.getLogger('requests').setLevel(logging.WARNING) # silence Requests library logging.getLogger('paste.httpserver').setLevel(logging.WARNING) # silence Paste library logging.getLogger('elasticsearch').setLevel(logging.WARNING) # silence Elastic library - +logging.getLogger('urllib3').setLevel(logging.WARNING) # silence urllib3 library # NOTE: Keep in sync with environment variables in sample.config file. DEFAULT_CONFIG = { diff --git a/api/files.py b/api/files.py index d781f86ce..5e3da5a34 100644 --- a/api/files.py +++ b/api/files.py @@ -18,8 +18,9 @@ class FileProcessor(object): def __init__(self, base, presistent_fs): self.base = base self._tempdir_name = str(uuid.uuid4()) - self._temp_fs = fs.subfs.SubFS(presistent_fs, fs.path.join('tmp', self._tempdir_name)) self._presistent_fs = presistent_fs + self._presistent_fs.makedirs(fs.path.join('tmp', self._tempdir_name), recreate=True) + self._temp_fs = fs.subfs.SubFS(presistent_fs, fs.path.join('tmp', self._tempdir_name)) def store_temp_file(self, src_path, dest_path): if not isinstance(src_path, unicode): diff --git a/api/handlers/listhandler.py b/api/handlers/listhandler.py index 2493e1065..d3f2f0fba 100644 --- a/api/handlers/listhandler.py +++ b/api/handlers/listhandler.py @@ -1,3 +1,4 @@ +import os import bson import copy import datetime diff --git a/raml/schemas/definitions/analysis.json b/raml/schemas/definitions/analysis.json deleted file mode 100644 index e69de29bb..000000000 diff --git a/raml/schemas/definitions/file.json b/raml/schemas/definitions/file.json deleted file mode 100644 index e69de29bb..000000000 diff --git a/swagger/schemas/definitions/file.json b/swagger/schemas/definitions/file.json index f6cc81590..2dbe43b14 100644 --- a/swagger/schemas/definitions/file.json +++ b/swagger/schemas/definitions/file.json @@ -1,6 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", "definitions":{ + "_id": { "type": "string" }, "name": { "type": "string" }, "file-type": { "type": "string" }, "mimetype": { "type": "string" }, @@ -44,6 +45,7 @@ "file": { "type": "object", "properties": { + "_id": {"$ref":"#/definitions/_id"}, "name": {"$ref":"#/definitions/name"}, "type": {"$ref":"#/definitions/file-type"}, "mimetype": {"$ref":"#/definitions/mimetype"}, diff --git a/tests/integration_tests/python/test_resolver.py b/tests/integration_tests/python/test_resolver.py index 8a32629ee..b772a03d0 100644 --- a/tests/integration_tests/python/test_resolver.py +++ b/tests/integration_tests/python/test_resolver.py @@ -177,10 +177,10 @@ def idz(s): return '' # resolve root/group/project/session/acquisition/file with id - r = as_admin.post('/resolve', json={'path': [idz(group), idz(project), idz(session), idz(acquisition), acquisition_file]}) + r = as_admin.post('/resolve', json={'path': [idz(group), idz(project), idz(session), idz(acquisition), idz(acquisition_file)]}) result = r.json() assert r.ok - assert path_in_result([group, project, session, acquisition, acquisition_file], result) + assert path_in_result([group, project, session, acquisition, acquisition_file_id], result) assert result['children'] == [] # try to resolve non-existent root/group/project/session/acquisition/child