Skip to content

Commit

Permalink
fix url formatting and EnvironmentLogger metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Burnette committed Jan 28, 2020
1 parent 885a3ae commit b55d071
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/upload_directories_to_clowder.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
# ---------------------------------
# Clowder instance configuration
# ---------------------------------
clowder_host = "https://terraref.ncsa.illinois.edu/clowder"
clowder_admin_key = "SECRET_KEY"
clowder_host = "https://terraref.ncsa.illinois.edu/clowder/"
# The following user will be shown as the creator and owner of uploaded datasets
clowder_user = "terrarefglobus+uamac@ncsa.illinois.edu"
clowder_pass = "PASSWORD"
Expand Down Expand Up @@ -116,7 +116,7 @@ def upload_dataset(dataset_path, level, product, timestamp, sess, logfile):
if dry_run:
print("...%s successfully loaded." % os.path.join(dataset_path, f))

if clean_md is None:
if clean_md is None and product is not "EnvironmentLogger":
logfile.write('%s,%s,"%s",%s\n' % (level, product, dataset_path, "ERR: No metadata found"))
return False

Expand All @@ -134,8 +134,8 @@ def upload_dataset(dataset_path, level, product, timestamp, sess, logfile):
logfile.write('%s,%s,"%s",%s\n' % (level, product, dataset_path, "OK: %s" % dsid))

# Upload metadata
if not dry_run:
sess.post("%s/api/datasets/%s/metadata.jsonld" % (clowder_host, dsid),
if not dry_run and product is not "EnvironmentLogger":
sess.post("%sapi/datasets/%s/metadata.jsonld" % (clowder_host, dsid),
headers={'Content-Type':'application/json'},
data=json.dumps({
"@context": ["https://clowder.ncsa.illinois.edu/contexts/metadata.jsonld",
Expand Down

0 comments on commit b55d071

Please sign in to comment.