Skip to content

Commit

Permalink
Set object_length if present in the collection inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark S. Bentley committed Dec 2, 2024
1 parent ac1924c commit a9aef88
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pds4_utils/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def set_if_exists(root, xpath, value):

# write the filename, checksum and number of records into the template
set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:Inventory/pds:records', len(index))
set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:Inventory/pds:object_length', os.path.getsize(csv_file))
set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:File/pds:records', len(index))
set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:File/pds:file_name', collection_csv)
set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:File/pds:md5_checksum', common.md5_hash(csv_file))
Expand Down

0 comments on commit a9aef88

Please sign in to comment.