Skip to content

Commit

Permalink
Refactor TDRHCABundle._parse_drs_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc authored and hannes-ucsc committed Aug 29, 2024
1 parent 8a9138f commit efccf7b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/azul/plugins/repository/tdr_hca/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@ def _add_manifest_entry(self,
is_stitched: bool,
checksums: Optional[Checksums] = None,
drs_uri: Optional[str] = None) -> None:
# These requirements prevent mismatches in the DRS domain, and ensure
# that changes to the column syntax don't go undetected.
if drs_uri is not None:
parsed = RegularDRSURI.parse(drs_uri)
require(parsed.uri.netloc == config.tdr_service_url.netloc)
self.manifest.append({
'name': name,
'uuid': uuid,
Expand Down Expand Up @@ -288,6 +283,10 @@ def _parse_drs_uri(self,
external_drs_uri = None
return external_drs_uri
else:
# This requirement prevent mismatches in the DRS domain, and ensures
# that changes to the column syntax don't go undetected.
parsed = RegularDRSURI.parse(file_id)
require(parsed.uri.netloc == config.tdr_service_url.netloc)
return file_id


Expand Down

0 comments on commit efccf7b

Please sign in to comment.