Changeset 7696


Ignore:
Timestamp:
03/11/10 08:57:41 (9 years ago)
Author:
pjkersha
Message:
  • fix to ndg.xacml.utils.factory.importModuleObject to set objectName to list type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/ndg_xacml/ndg/xacml/utils/factory.py

    r7072 r7696  
    3535        else:  
    3636            _moduleName, objectName = moduleName.rsplit('.', 1) 
    37             objectName = [objectName] 
    3837    else: 
    3938        _moduleName = moduleName 
    40         if isinstance(objectName, basestring): 
    41             objectName = [objectName] 
     39         
     40    if isinstance(objectName, basestring): 
     41        objectName = [objectName] 
    4242     
    4343    module = __import__(_moduleName, globals(), locals(), []) 
     
    4646        for component in components[1:]: 
    4747            module = getattr(module, component) 
    48     except AttributeError, e: 
     48    except AttributeError: 
    4949        raise AttributeError("Error importing %r: %s" % 
    5050                             (objectName[0], traceback.format_exc())) 
     
    6464 
    6565def callModuleObject(moduleName, objectName=None, moduleFilePath=None,  
    66                      objectType=None, objectArgs=(), objectProperties={}): 
     66                     objectType=None, objectArgs=None, objectProperties=None): 
    6767    ''' 
    6868    Create and return an instance of the specified class or invoke callable 
     
    8383    @return: object - instance of the class specified  
    8484    ''' 
    85  
    8685     
    8786    # ensure that properties is a dict - NB, it may be passed in as a null 
     
    8988    if not objectProperties: 
    9089        objectProperties = {} 
     90 
     91    if not objectArgs: 
     92        objectArgs = () 
    9193 
    9294    # variable to store original state of the system path 
Note: See TracChangeset for help on using the changeset viewer.