Skip to content

Commit fe490f6

Browse files
committed
back to unprocessable entry problem
1 parent 97470eb commit fe490f6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pyclowder/api/v2/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def download_info(connector, host, key, fileid, token=None):
8080
# fetch data
8181
result = connector.get(url, stream=True, verify=connector.ssl_verify if connector else True, headers=headers)
8282

83-
return result.json()
83+
return result
8484

8585

8686
def download_metadata(connector, host, key, fileid, extractor=None, token=None):

pyclowder/files.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from pyclowder.datasets import get_file_list
1616
from pyclowder.collections import get_datasets, get_child_collections
17-
import api.v2.files as v2files
17+
import pyclowder.api.v2.files as v2files
1818

1919
from dotenv import load_dotenv
2020
load_dotenv()
@@ -42,7 +42,8 @@ def download(connector, host, key, fileid, intermediatefileid=None, ext="", toke
4242
ext -- the file extension, the downloaded file will end with this extension
4343
"""
4444
if clowder_version >= 2.0:
45-
v2files.download(connector, host, key, fileid, intermediatefileid, ext, token)
45+
inputfilename = v2files.download(connector, host, key, fileid, intermediatefileid, ext, token)
46+
return inputfilename
4647
else:
4748
connector.message_process({"type": "file", "id": fileid}, "Downloading file.")
4849

@@ -77,7 +78,8 @@ def download_info(connector, host, key, fileid, token=None):
7778
"""
7879

7980
if clowder_version >= 2.0:
80-
v2files.download_info(conector, host, key, fileid, token)
81+
result = v2files.download_info(connector, host, key, fileid, token)
82+
return result.json()
8183
else:
8284
url = '%sapi/files/%s/metadata?key=%s' % (host, fileid, key)
8385
headers = {"Authorization": "Bearer " + token}

0 commit comments

Comments
 (0)