IdentityPython / pyFF

SAML metadata aggregator
https://pyff.io/
Other
50 stars 37 forks source link

Finalize command fails with error 'datetime.timedelta' object has no attribute 'total_seconds' #4

Closed salaun-urennes1 closed 11 years ago

salaun-urennes1 commented 11 years ago

Hi Leif,

I am evaluating pyFF as a metadata tool for our federation in the eduGAIN context. I successfully install it and ran some simple exemples. However pyff fails if I add the finalize command to the pipeline.

Do you have a clue of what goes wrong?

I hope that's the right place to report my issue; I could find a pyFF users mailing list.

Here is my pipeline definition:

Here is the output of pyff: %/opt/pyff/bin/pyff --loglevel=DEBUG example2.fd DEBUG:root:Processing

DEBUG:root:importing builtins from pyff.pipes to find load DEBUG:root:load http://mds.edugain.org edugain-signer.crt DEBUG:root:remote http://mds.edugain.org edugain-signer.crt None DEBUG:root:Starting fetcher for http://mds.edugain.org DEBUG:root:Waiting for next thread to finish... DEBUG:root:fetching http://mds.edugain.org without using cache DEBUG:root:got 1314739 bytes from http://mds.edugain.org DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/ws-federation.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' oasis-200401-wss-wssecurity-secext-1.0.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' oasis-200401-wss-wssecurity-utility-1.0.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' xml.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' xmldsig-core-schema.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' ws-addr.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' MetadataExchange.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' saml-schema-metadata-2.0.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' xenc-schema.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' sstc-saml-schema-assertion-2.0.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' ws-securitypolicy-1.2.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' ws-authorization.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/cs-sstc-schema-assertion-1.1.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/sstc-saml-metadata-ui-v1.0.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/privacy.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/shibboleth-metadata-1.0.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/shibboleth-trust-1.0.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/shibboleth.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/sstc-metadata-attr.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/sstc-saml-metadata-algsupport.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/sstc-saml-idp-discovery.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/atom.xsd' for 'None' DEBUG:root:resolve SYSTEM URL' /opt/pyff/lib/python2.6/site-packages/pyff/schema/xrd-1.0-os.xsd' for 'None' DEBUG:root:verifying signature using edugain-signer.crt DEBUG:root:key size: 2048 bits DEBUG:root:Looking for #eduGAIN using id attribute 'ID' DEBUG:root:transform: http://www.w3.org/2000/09/xmldsig#enveloped-signature DEBUG:root:transform: http://www.w3.org/2001/10/xml-exc-c14n DEBUG:root:using hash algorithm sha1 DEBUG:root:digest for #eduGAIN: 9zmDg91vvpunMVQ6nX49As+ttlg= DEBUG:root:9zmDg91vvpunMVQ6nX49As+ttlg=/ds:DigestValue

DEBUG:root:SignedInfo C14N:

/ds:CanonicalizationMethod /ds:SignatureMethod ds:Transforms /ds:Transform /ec:InclusiveNamespaces/ds:Transform /ds:Transforms /ds:DigestMethod ds:DigestValue9zmDg91vvpunMVQ6nX49As+ttlg=/ds:DigestValue /ds:Reference /ds:SignedInfo DEBUG:root:SignedInfo digest: PmSazR9Zu4WCeqAEN83aw3tXwaM= DEBUG:root:got fresh metadata (date: 2013-04-08 09:14:19) DEBUG:root:importing builtins from pyff.pipes to find select DEBUG:root:string lookup http://mds.edugain.org!//md:EntityDescriptor[md:IDPSSODescriptor] DEBUG:root:selecting http://mds.edugain.org filtered by //md:EntityDescriptor[md:IDPSSODescriptor] DEBUG:root:string lookup http://mds.edugain.org DEBUG:root:basic lookup http://mds.edugain.org DEBUG:root:xpath filter //md:EntityDescriptor[md:IDPSSODescriptor] <- DEBUG:root:selecting 112 entities from 1 entity set(s) before validation DEBUG:root:importing builtins from pyff.pipes to find finalize Traceback (most recent call last): File "/opt/pyff/lib/python2.6/site-packages/pyff/**init**.py", line 44, in main plumbing(p).process(md,state={'batch': True, 'stats': {}}) File "/opt/pyff/lib/python2.6/site-packages/pyff/pipes/**init**.py", line 154, in process self._process(req) File "/opt/pyff/lib/python2.6/site-packages/pyff/pipes/__init__.py", line 172, in _process ot = pipe(req,*opts) File "/opt/pyff/lib/python2.6/site-packages/pyff/pipes/builtins.py", line 840, in finalize req.state['cache'] = int(offset.total_seconds() / 50) AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds' ERROR:root:'datetime.timedelta' object has no attribute 'total_seconds' ## [('http://mds.edugain.org', 'edugain-signer.crt', None, 0)] --- Thanks.
peter- commented 11 years ago

Are you sure you're current? That should have been fixed a couple of days ago, see https://github.com/leifj/pyFF/pull/3

leifj commented 11 years ago

On 04/08/2013 11:51 AM, peter- wrote:

Are you sure you're current? That should have been fixed a couple of days ago, see #3 https://github.com/leifj/pyFF/issues/3

— Reply to this email directly or view it on GitHub https://github.com/leifj/pyFF/issues/4#issuecomment-16041642.

Yeah this is a 2.6 vs 2.7 issue originally but I tried to work around it with that fix...

salaun-urennes1 commented 11 years ago

I installed pyFF as documented; "pip install pyFF"

How can I determine the version of pyFF I'm running? I tried "pyff --help" but it doen't provide a version number; --version option is not implemented

cat pyff:

!/opt/pyff/bin/python

EASY-INSTALL-ENTRY-SCRIPT: 'pyFF==0.9dev','console_scripts','pyff'

requires = 'pyFF==0.9dev' import sys from pkg_resources import load_entry_point

sys.exit( load_entry_point('pyFF==0.9dev', 'console_scripts', 'pyff')() )

salaun-urennes1 commented 11 years ago

Does it mean I should upgrade pyFF? I'm not familiar with Python; can I upgrade using pip?

peter- commented 11 years ago

Currently you need to run master from github. Same for pyXMLSecurity, I think. Just clone both from git and then ./setup.py install in each of the working copies (with pyXMLSecrurity first).

Forget about pip until there's a working release of pyFF there. You could pip uninstall all versions installed in your virtualenv and git clone as above. Or just scrap that virtualenv and make a new one.

leifj commented 11 years ago

On 04/08/2013 12:19 PM, peter- wrote:

  • salaun-renater notifications@github.com [2013-04-08 12:04]:

    I installed pyFF as documented; "pip install pyFF"

Currently you need to run master from github. Same for pyXMLSecurity, I think. Just clone both from git and then ./setup.py install in each of the working copies (with pyXMLSecrurity first). Actually pyXMLSecurity is now released. I'm pushing pyFF later today so you could just wait a bit :-)

Forget about pip until there's a working release of pyFF there. You could pip uninstall all versions installed in your virtualenv and git clone as above. Or just scrap that virtualenv and make a new one.

— Reply to this email directly or view it on GitHub https://github.com/leifj/pyFF/issues/4#issuecomment-16042770.

salaun-urennes1 commented 11 years ago

Ok, I'll wait for the newer version of pyFF. Thanks to both of you.