Commit 13bf6707 authored by Merlijn Wajer's avatar Merlijn Wajer
Browse files

metadata: remove entries with no value

When we encountered items with no value set at all, like so:


Our code tripped when writing the metadata back to _meta.xml format;
because the entry got the value None in Python. Petabox team suggested
to just drop the entry, causing it to be done after the metadata is
writtne back to the item.

Hank wrote:

> yeah, that’s an empty value (same as <lcamid></lcamid>); i would also be fine with just dropping them when encountered—i think some of our tools may do that.

Jim wrote:

> I would just treat it as though it wasn’t set.  I think MDAPI will drop a metadata key if the value is empty, perhaps this was added through some other mechanism.
parent 89184725
......@@ -22,6 +22,8 @@ def parse_item_metadata(path):
md[elem.tag] = [md[elem.tag], elem.text]
if elem.text is None:
md[elem.tag] = elem.text
return md
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment