Ignore:
Timestamp:
Nov 24, 2010 3:45:50 PM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
725c55d
Parents:
de7cb08
Message:

Checkpoint. Still lots to do

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/authorizer.py

    rde7cb08 rc573278  
    1818
    1919import sys
    20 import os
     20import os, os.path
    2121import re
    2222
     
    201201        self.me = me
    202202        self.save_dir = load or save
     203        if self.save_dir:
     204            self.save_dir = os.path.abspath(self.save_dir)
    203205        # If the me parameter is a combination certificate, split it into the
    204206        # abac_authorizer save directory (if any) for use with creddy.
     
    246248    def import_credential(self, file=None, data=None):
    247249        if data:
    248             if self.context.load_id_chunk(data) != ABAC.ABAC_CERT_SUCCESS:
    249                 return self.context.load_attribute_chunk(data) == \
    250                         ABAC.ABAC_CERT_SUCCESS
    251             else:
    252                 return True
     250            rv = self.context.load_id_chunk(data)
     251            print "id %d" % rv
     252            if rv == ABAC.ABAC_CERT_SUCCESS: return True
     253            rv = self.context.load_attribute_chunk(data)
     254            print "attr %d" % rv
     255            return rv == ABAC.ABAC_CERT_SUCCESS
     256            #if self.context.load_id_chunk(data) != ABAC.ABAC_CERT_SUCCESS:
     257        #       return self.context.load_attribute_chunk(data) == \
     258        #               ABAC.ABAC_CERT_SUCCESS
     259            ##else:
     260        #       return True
    253261        elif file:
    254262            if self.context.load_id_file(file) != ABAC.ABAC_CERT_SUCCESS:
     
    388396        self.lock.acquire()
    389397        if dir:
    390             self.save_dir = dir
     398            self.save_dir = os.path.abspath(dir)
    391399        else:
    392400            dir = self.save_dir
     
    503511            look_for = next_look
    504512            next_look = set()
     513        self.lock.release()
    505514       
    506515        return found
Note: See TracChangeset for help on using the changeset viewer.