Ignore:
Timestamp:
04/11/10 13:55:40 (10 years ago)
Author:
pjkersha
Message:

Integrated SAML ESGF Group/Role? attribute value type into SAML Attribute Authority client unit tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDGSecurity/python/ndg_security_common/ndg/security/common/utils/factory.py

    r7076 r7698  
    3838            except ValueError: 
    3939                raise ValueError('Invalid module name %r set for import: %s' % 
    40                                  (moduleName, traceback.format_exc())) 
    41                  
    42             objectName = [objectName] 
     40                                 (moduleName, traceback.format_exc()))         
    4341    else: 
    4442        _moduleName = moduleName 
    45         if isinstance(objectName, basestring): 
    46             objectName = [objectName] 
     43         
     44    if isinstance(objectName, basestring): 
     45        objectName = [objectName] 
    4746     
    4847    log.debug("Importing %r ..." % objectName)  
     
    5352        for component in components[1:]: 
    5453            module = getattr(module, component) 
    55     except AttributeError, e: 
     54    except AttributeError: 
    5655        raise AttributeError("Error importing %r: %s" % 
    5756                             (objectName, traceback.format_exc())) 
     
    7170 
    7271def callModuleObject(moduleName, objectName=None, moduleFilePath=None,  
    73                      objectType=None, objectArgs=(), objectProperties={}): 
     72                     objectType=None, objectArgs=None, objectProperties=None): 
    7473    ''' 
    7574    Create and return an instance of the specified class or invoke callable 
     
    9089    @return: object - instance of the class specified  
    9190    ''' 
    92  
    9391     
    9492    # ensure that properties is a dict - NB, it may be passed in as a null 
     
    9795        objectProperties = {} 
    9896 
     97    if not objectArgs: 
     98        objectArgs = () 
     99         
    99100    # variable to store original state of the system path 
    100101    sysPathBak = None 
     
    131132 
    132133    # Instantiate class 
    133     log.debug('Instantiating object "%s"' % importedObject.__name__) 
     134    log.debug('Instantiating object "%s"', importedObject.__name__) 
    134135    try: 
    135136        if objectArgs: 
Note: See TracChangeset for help on using the changeset viewer.