Skip to content

Commit

Permalink
Silenc urllib3 library log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfarkas committed Feb 27, 2018
1 parent 32d55da commit 938e9a9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion api/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions api/handlers/listhandler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import bson
import copy
import datetime
Expand Down
Empty file.
Empty file removed raml/schemas/definitions/file.json
Empty file.
2 changes: 2 additions & 0 deletions swagger/schemas/definitions/file.json
Original file line number Diff line number Diff line change
@@ -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" },
Expand Down Expand Up @@ -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"},
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/python/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ def idz(s):
return '<id:' + s + '>'

# 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
Expand Down

0 comments on commit 938e9a9

Please sign in to comment.