Esempio n. 1
0
def isCredentialRequired(credObj):
    """
    The logic to decide if a given invalid credential
    should trigger the deactivation of Ganga internal services.  
    """

    from Ganga.Runtime import Workspace_runtime
    from Ganga.Runtime import Repository_runtime

    if getName(credObj) == 'AfsToken':
        return Workspace_runtime.requiresAfsToken() or Repository_runtime.requiresAfsToken()

    if getName(credObj) == 'GridProxy':
        from Ganga.Core.GangaRepository import getRegistryProxy
        from Ganga.Runtime.GPIFunctions import typename
        from Ganga.GPIDev.Base.Proxy import stripProxy
        from Ganga.GPIDev.Lib.Job.Job import lazyLoadJobBackend, lazyLoadJobStatus
        for j in getRegistryProxy('jobs'):
            ji = stripProxy(j)
            this_status = lazyLoadJobStatus(ji)
            if this_status in ['submitted', 'running', 'completing']:
                this_backend = lazyLoadJobBackend(ji)
                if getName(this_backend) == 'LCG':
                    return True
        return False

    log.warning("Unknown credential object : %s" % credObj)
Esempio n. 2
0
def isCredentialRequired(credObj):
    """
    The logic to decide if a given invalid credential
    should trigger the deactivation of Ganga internal services.  
    """

    from Ganga.Runtime import Workspace_runtime
    from Ganga.Runtime import Repository_runtime

    if getName(credObj) == "AfsToken":
        return Workspace_runtime.requiresAfsToken() or Repository_runtime.requiresAfsToken()

    if getName(credObj) == "GridProxy":
        if Repository_runtime.requiresGridProxy() or Workspace_runtime.requiresGridProxy():
            return True
        from Ganga.GPI import jobs, typename
        from Ganga.GPIDev.Base.Proxy import stripProxy

        for j in jobs:
            ji = stripProxy(j)
            if ji.status in ["submitted", "running", "completing"]:
                if getName(ji.backend) == "LCG":
                    return True
        return False

    log.warning("Unknown credential object : %s" % credObj)
Esempio n. 3
0
def isCredentialRequired(credObj):
    """
    The logic to decide if a given invalid credential
    should trigger the deactivation of Ganga internal services.  
    """

    from Ganga.Runtime import Workspace_runtime
    from Ganga.Runtime import Repository_runtime

    if getName(credObj) == 'AfsToken':
        return Workspace_runtime.requiresAfsToken(
        ) or Repository_runtime.requiresAfsToken()

    if getName(credObj) == 'GridProxy':
        from Ganga.Core.GangaRepository import getRegistryProxy
        from Ganga.Runtime.GPIFunctions import typename
        from Ganga.GPIDev.Base.Proxy import stripProxy
        from Ganga.GPIDev.Lib.Job.Job import lazyLoadJobBackend, lazyLoadJobStatus
        for j in getRegistryProxy('jobs'):
            ji = stripProxy(j)
            this_status = lazyLoadJobStatus(ji)
            if this_status in ['submitted', 'running', 'completing']:
                this_backend = lazyLoadJobBackend(ji)
                if getName(this_backend) == 'LCG':
                    return True
        return False

    log.warning("Unknown credential object : %s" % credObj)
Esempio n. 4
0
def isCredentialRequired(credObj):
    """
    The logic to decide if a given invalid credential
    should trigger the deactivation of Ganga internal services.  
    """

    from Ganga.Runtime import Workspace_runtime
    from Ganga.Runtime import Repository_runtime

    if getName(credObj) == 'AfsToken':
        return Workspace_runtime.requiresAfsToken() or Repository_runtime.requiresAfsToken()

    if getName(credObj) == 'GridProxy':
        if Repository_runtime.requiresGridProxy() or Workspace_runtime.requiresGridProxy():
            return True
        from Ganga.GPI import jobs, typename
        from Ganga.GPIDev.Base.Proxy import stripProxy
        for j in jobs:
            ji = stripProxy(j)
            if ji.status in ['submitted', 'running', 'completing']:
                if ji.getNodeIndexCache() is not None and 'display:backend' in ji.getNodeIndexCache().keys():
                    if ji.getNodeIndexCache()['display:backend'] == 'LCG':
                        return True
                else:
                    if getName(ji.backend) == 'LCG':
                        return True
        return False

    log.warning("Unknown credential object : %s" % credObj)
Esempio n. 5
0
def isCredentialRequired (credObj):
    """
    The logic to decide if a given invalid credential
    should trigger the deactivation of Ganga internal services.  
    """

    from Ganga.Runtime import Workspace_runtime
    from Ganga.Runtime import Repository_runtime

    if credObj.__class__.__name__ == 'AfsToken':
        return Workspace_runtime.requiresAfsToken() or Repository_runtime.requiresAfsToken()

    if credObj.__class__.__name__ == 'GridProxy':
        if Repository_runtime.requiresGridProxy() or Workspace_runtime.requiresGridProxy():
           return True 
        from Ganga.GPI import jobs,typename
        return bool([j for j in jobs if typename(j.backend)=='LCG' and j.status in ['submitted','running','completing']])
    
    log.warning("Unknown credential object : %s" % credObj)