Ejemplo n.º 1
0
def getServiceManager(serviceName):
    print "getServiceManager"
    print "serviceName: ", serviceName
    scipionUserData = os.path.join(os.environ['SCIPION_USER_DATA'], serviceName)
    manager = Manager(SCIPION_USER_DATA = scipionUserData)
    
    manager.config = os.path.join(os.environ['HOME'], '.config', 'scipion', serviceName)
    manager.protocols = os.path.join(manager.config, 'protocols.conf')
    manager.hosts = os.path.join(manager.config, 'hosts.conf')
    
    print "config: ", manager.config
    print "protocols: ", manager.protocols
    print "hosts: ", manager.hosts
    
    return manager
Ejemplo n.º 2
0
def getServiceManager(serviceName):
    print "getServiceManager"
    print "serviceName: ", serviceName
    scipionUserData = os.path.join(os.environ['SCIPION_USER_DATA'],
                                   serviceName)
    manager = Manager(SCIPION_USER_DATA=scipionUserData)

    serviceConf = os.path.join(os.environ['HOME'], '.config', 'scipion',
                               serviceName)
    manager.config = os.path.join(serviceConf, 'scipion.conf')
    manager.protocols = os.path.join(serviceConf, 'protocols.conf')
    manager.hosts = os.path.join(serviceConf, 'hosts.conf')

    print "config: ", manager.config
    print "protocols: ", manager.protocols
    print "hosts: ", manager.hosts

    return manager
Ejemplo n.º 3
0
def getServiceManager(serviceName):
    global SERVICE_MANAGERS

    manager = SERVICE_MANAGERS.get(serviceName, None)

    if manager is None:
        print "...Creating new cached Manager"
        scipionUserData = os.environ['SCIPION_USER_DATA']
        servicePath = '' if serviceName is None else serviceName
        scipionUserData = os.path.join(scipionUserData, servicePath)

        manager = Manager(SCIPION_USER_DATA=scipionUserData)

        serviceConf = os.path.join(os.environ['HOME'], '.config', 'scipion',
                                   servicePath)
        manager.config = os.path.join(serviceConf, 'scipion.conf')
        manager.protocols = os.path.join(serviceConf, 'protocols.conf')
        manager.hosts = os.path.join(serviceConf, 'hosts.conf')
        SERVICE_MANAGERS[serviceName] = manager

    return manager