Description
We are using pyFF to agrgegate our federation metadata with eduGAIN metadata. We had an issue that made us publish the aggregate metadata with eduGAIN metadata only.
After some investigation I found out that pyff does not raise an exception if an input MD cannot be loaded. I suggest this not only adds an error log but raise an exception to prevent an uncomplete output file from being generated.
Here is a sample pipeline where one input metadata file is missing:
- load:
- /var/www/html/edugain/sps-edugain-metadata.xml
- /tmp/unknown-metadata.xml
- select
- finalize:
Name: https://federation.renater.fr/
cacheDuration: PT1H
validUntil: P6D - publish: /tmp/test-metadata.xml
- stats
Here is pyff output:
None
None
ERROR:root:Don't know how to load '/tmp/unknown-metadata.xml' as None verify None via None
[('file:///var/www/html/edugain/sps-edugain-metadata.xml', None, None, None)]
[('file:///var/www/html/edugain/sps-edugain-metadata.xml', None, None, 0, None)]
ERROR:root:[Errno 1] Operation not permitted
total size: 2
selected: 123
idps: 0
sps: 123
It seems that this part of builtins.py should be changed:
else:
log.error("Don't know how to load '%s' as %s verify %s via %s" %
(url, params['as'], params['verify'], params['via']))