Skip to content

Commit b0a94e2

Browse files
committed
using host and key as arguments to match v1
1 parent c856883 commit b0a94e2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pyclowder/api/v2/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def upload_to_dataset(connector, client, datasetid, filepath, check_duplicate=Fa
268268
logger = logging.getLogger(__name__)
269269

270270
if check_duplicate:
271-
ds_files = get_file_list(connector, client, datasetid)
271+
ds_files = get_file_list(connector, client.host, client.key, datasetid)
272272
for f in ds_files:
273273
if f['name'] == os.path.basename(filepath):
274274
logger.debug("found %s in dataset %s; not re-uploading" % (f['name'], datasetid))

pyclowder/datasets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def get_info(connector, host, key, datasetid):
134134
return info
135135

136136

137-
def get_file_list(connector, client, datasetid):
137+
def get_file_list(connector, host, key, datasetid):
138138
"""Get list of files in a dataset as JSON object.
139139
140140
Keyword arguments:
@@ -143,6 +143,7 @@ def get_file_list(connector, client, datasetid):
143143
key -- the secret key to login to clowder
144144
datasetid -- the dataset to get filelist of
145145
"""
146+
client = ClowderClient(host=host, key=key)
146147
if clowder_version == 2:
147148
file_list = v2datasets.get_file_list(connector, client, datasetid)
148149
else:

0 commit comments

Comments
 (0)