Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create amdSec when bag metadata is empty #2013

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

replaceafill
Copy link
Member

@replaceafill replaceafill commented Jan 9, 2025

This prevents the creation and association of a amdSec element to the objects directory in the structMap when the transfer bag metadata is missing or unreadable.

Connected to archivematica/Issues#1129

This simulates the scenarios where a bag does not contain a
bag-info.txt and bagit returns an empty dictionary for its info
attribute or when reading the bag goes wrong and the create_mets_v2
script logs the problem but also returns an empty dictionary.

These scenario raise the same exception shown in issue #1129.
In the create_mets_v2.create_object_metadata function, the bag_info
variable represents a list of dictionaries with bag information.

The problem is that a list like [{}] which should be ignored (no bag
metadata) is considered truth-y at the moment.
Copy link
Contributor

@Dhwaniartefact Dhwaniartefact left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@replaceafill replaceafill merged commit 60fc2c5 into qa/1.x Jan 9, 2025
22 checks passed
@replaceafill replaceafill deleted the dev/issue-1129-fix-bogus-amdsec branch January 9, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants