Skip to content

pyff should stop processing if one input MD is missing #47

Closed
@salaun-urennes1

Description

@salaun-urennes1

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']))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions