Skip to content

Commit

Permalink
Arkivum checksum bug: fixes to docstrings and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwdunham committed Jul 20, 2017
1 parent 27209c6 commit f0531cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions storage_service/locations/models/arkivum.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ def post_move_from_storage_service(self, staging_path, destination_path, package
url = 'https://' + self.host + '/api/2/files/release/' + relative_path
headers = {'Content-Type': 'application/json'}

# Get size, checksum, and checksum algorithm from pointer file;
# infer compression algorithm from filename.
# Get size, checksum, and checksum algorithm from pointer file.
root = etree.parse(package.full_pointer_file_path)
fixity_elem = root.find('.//premis:fixity', namespaces=utils.NSMAP)
algorithm = fixity_elem.findtext(
Expand Down
5 changes: 5 additions & 0 deletions storage_service/locations/tests/test_arkivum.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@


def get_pkg_uuid_path(package_uuid):
"""Convert a UUID string to a string representation of a directory strucure
generated from it, e.g.,
input: ``'b9a07040-4f08-4a9c-b88a-5cc325e17e7e'``
output: ``'b9a0/7040/4f08/4a9c/b88a/5cc3/25e1/7e7e'``
"""
tmp = package_uuid.replace('-', '')
return os.path.join(*[tmp[i:i + 4] for i in range(0, len(tmp), 4)])

Expand Down

0 comments on commit f0531cc

Please sign in to comment.