Skip to content

Commit

Permalink
fix: Stage in root url relative (#63)
Browse files Browse the repository at this point in the history
* feat: add AUDIT log level for upload

* chore: update outdated tests

* fix: allow empty str as RESULT_PATH_PREFIX & replace w/ default val

* fix: root href is relative now
  • Loading branch information
wphyojpl authored Dec 2, 2024
1 parent 295d47a commit ebdb5bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions mdps_ds_lib/stage_in_out/download_granules_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ def download(self, **kwargs) -> str:
catalog = Catalog(
id='NA',
description='NA')
catalog.set_self_href(os.path.join(self._download_dir, 'catalog.json'))
# catalog.add_link(Link('item', failed_features_file, 'application/json'))

catalog.add_link(Link('root', f'catalog.json', 'application/json'))
if len(self._granules_json.items) < 1:
LOGGER.warning(f'cannot find any granules')
granules_json_dict = self._granules_json.to_dict(False)
Expand Down
1 change: 1 addition & 0 deletions tests/integration_tests/test_docker_stage_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,7 @@ def test_02_download__from_http_with_role(self):
catalog_result = FileUtils.read_json(f'{downloading_dir}/catalog.json')
print(catalog_result)
catalog_result = Catalog.from_dict(catalog_result)
self.assertEqual(catalog_result.links[0].href, 'catalog.json', f'wrong root: {catalog_result.links[0]}')
for each in catalog_result.links[1:]:
print(FileUtils.read_json(f'{downloading_dir}/{each.href}'))
for each_granule in zip(granule_json['features'], download_result):
Expand Down

0 comments on commit ebdb5bc

Please sign in to comment.