Skip to content
Snippets Groups Projects
Commit b242c88e authored by Francois Ancien's avatar Francois Ancien
Browse files

Improving urlparsing in update-dcat.py;

Correcting cast issue in post-assets-metadata.py;
Correcting typo in update-catalog-assets.cwl
parent 0ca3f082
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ def main(files_list):
res = requests.post("http://iderha-catalog:3000/api/catalog", json=catalogs_list, headers={"Content-Type": "application/json"})
# Writing status code in an output file for subsequent steps to retrieve
with open("response.txt", "w") as f:
f.write(res.status_code)
f.write(str(res.status_code))
if not res.ok:
error = f"An error occurred while pushing assets metadata: {res.content}"
......
......@@ -19,10 +19,16 @@ def main():
file_locations = {}
for l in args.location:
policy_id = get_policy_id(l)
parsed_url = urlparse(l)
parsed_url = parsed_url._replace(
scheme="http",
path=parsed_url.path.replace("/home/ftp_iderha_user", "", 1)
)
if policy_id in file_locations:
file_locations[policy_id][Path(l).name] = urlparse(l)._replace(scheme="http").geturl()
file_locations[policy_id][Path(l).name] = parsed_url.geturl()
else:
file_locations[policy_id] = {Path(l).name : urlparse(l)._replace(scheme="http").geturl()}
file_locations[policy_id] = {Path(l).name: parsed_url.geturl()}
with open(args.input) as f:
dcat = json.load(f)
......@@ -48,7 +54,7 @@ def main():
"@id": "virtualLocation"
},
"odrl:operator": {
"@id": "eq"
"@id": "odrl:eq"
},
"odrl:rightOperand": url_constraint
}
......
......@@ -56,4 +56,4 @@ steps:
status: updateCatalog/status
out: []
run: reset-catalog-update-status.cwl
when: $(inputs.status.search("2[0-9]{2}" === 0;))
when: $(inputs.status.search("2[0-9]{2}" === 0))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment