make export a bit more resilient. If there's a piece of metadata that we can't serialize - i.e. someone wrote a new bool attribute and didn't put it in the type mapping table - then we log the exception and continue.
This commit is contained in:
@@ -379,7 +379,11 @@ class XmlDescriptor(XModuleDescriptor):
|
||||
if attr not in self.metadata_to_strip and attr not in self.metadata_to_export_to_policy:
|
||||
val = val_for_xml(attr)
|
||||
#logging.debug('location.category = {0}, attr = {1}'.format(self.location.category, attr))
|
||||
xml_object.set(attr, val)
|
||||
try:
|
||||
xml_object.set(attr, val)
|
||||
except Exception, e:
|
||||
logging.exception('Failed to serialize metadata attribute {0} with value {1}. This could mean data loss!!! Exception: {2}'.format(attr, val, e))
|
||||
pass
|
||||
|
||||
if self.export_to_file():
|
||||
# Write the definition to a file
|
||||
|
||||
Reference in New Issue
Block a user