Ignore:
Timestamp:
Dec 14, 2010 6:58:28 PM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
c092b7f
Parents:
2627eb3
Message:

Move proofs around. Lots of changes, including fault handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/remote_service.py

    r2627eb3 re83f2f2  
    1616import httplib
    1717
     18from proof import proof
    1819from service_error import service_error
    1920from xmlrpclib import ServerProxy, dumps, loads, Fault, Error, Binary
     
    6667    # A map used to encapsulate fedids into xmlrpclib.Binary objects
    6768    encap_fedids = (('fedid', to_binary),)
     69
     70    # fields that are never unicoded, because they represent non strings.
     71    do_not_unicode = set(['credential'])
    6872
    6973    @staticmethod
     
    172176        if isinstance(obj, dict):
    173177            for k in obj.keys():
    174                 obj[k] = remote_service_base.make_unicode(obj[k])
     178                if k not in remote_service_base.do_not_unicode:
     179                    obj[k] = remote_service_base.make_unicode(obj[k])
    175180            return obj
    176181        elif isinstance(obj, basestring) and not isinstance(obj, unicode):
     
    513518                            'desc': e.fault.string or "Something Weird" }
    514519                if ee:
     520                    if 'proof' in ee:
     521                        pl = [ proof.from_dict(p) for p in ee['proof']]
     522                    else:
     523                        pl = None
    515524                    raise service_error(ee.get('code', 'no code'),
    516                             ee.get('desc','no desc'))
     525                            ee.get('desc','no desc'), proof=pl)
    517526                else:
    518527                    raise service_error(service_error.internal,
Note: See TracChangeset for help on using the changeset viewer.