コード例 #1
0
def process(siteDefs, out=sys.stdout):

    if siteDefs.clusterStandAloneMode():
        #
        # Endpoint is not available on cluster node alone
        #
        return

    now = CommonUtils.getNow()

    endPointID = siteDefs.ceHost + '_org.glite.ce.CREAM'
    endPointDN = 'GLUE2EndpointID=%s,GLUE2ServiceID=%s,GLUE2GroupID=resource,o=glue' \
                  % (endPointID, siteDefs.compServiceID)
    implVer, ifaceVer = ServiceInfoUtils.getCREAMServiceInfo()
    hostDN, hostIssuer = ServiceInfoUtils.getHostCertInfo()
    #
    # TODO Validity is hard-coded for now (1hour in seconds)
    #
    validity = 3600
    statusCode, statusInfo = ServiceInfoUtils.getTomcatStatus()
    srvState, srvStarttime = ServiceInfoUtils.getCREAMServingState()

    out.write("dn: %s\n" % endPointDN)

    out.write("objectClass: GLUE2Entity\n")
    out.write("objectClass: GLUE2Endpoint\n")
    out.write("objectClass: GLUE2ComputingEndpoint\n")

    out.write("GLUE2EntityName: %s\n" % endPointID)
    out.write("GLUE2EntityCreationTime: %s\n" % now)
    out.write("GLUE2EntityValidity: %d\n" % validity)
    out.write("GLUE2EntityOtherInfo: HostDN=%s\n" % hostDN)
    out.write("GLUE2EntityOtherInfo: InfoProviderName=%s\n" %
              CommonUtils.providerName)
    out.write("GLUE2EntityOtherInfo: InfoProviderVersion=%s\n" %
              CommonUtils.providerVersion)
    out.write("GLUE2EntityOtherInfo: InfoProviderHost=%s\n" % siteDefs.ceHost)
    out.write("GLUE2EntityOtherInfo: ArgusEnabled=%s\n" %
              repr(siteDefs.argusEnabled).upper())

    out.write("Glue2EndpointStartTime: %s\n" % now)
    out.write("GLUE2EndpointID: %s\n" % endPointID)
    out.write("GLUE2EndpointURL: https://%s:%d/ce-cream/services\n" %
              (siteDefs.ceHost, siteDefs.cePort))
    out.write("GLUE2EndpointCapability: executionmanagement.jobexecution\n")
    out.write("GLUE2EndpointTechnology: webservice\n")
    out.write("GLUE2EndpointInterfaceName: org.glite.ce.CREAM\n")
    out.write("GLUE2EndpointInterfaceVersion: %s\n" % ifaceVer)
    out.write(
        "GLUE2EndpointWSDL: https://%s:%d/ce-cream/services/CREAM2?wsdl\n" %
        (siteDefs.ceHost, siteDefs.cePort))
    out.write(
        "GLUE2EndpointSupportedProfile: http://www.ws-i.org/Profiles/BasicProfile-1.0.html\n"
    )
    out.write(
        "GLUE2EndpointSemantics:http://wiki.italiangrid.org/twiki/bin/view/CREAM/UserGuide\n"
    )
    out.write("GLUE2EndpointImplementor: gLite\n")
    out.write("GLUE2EndpointImplementationName: CREAM\n")
    out.write("GLUE2EndpointImplementationVersion: %s\n" % implVer)
    out.write("GLUE2EndpointQualityLevel: production\n")

    out.write("GLUE2EndpointHealthState: %s\n" % statusCode)
    out.write("GLUE2EndpointHealthStateInfo: %s\n" % statusInfo)
    out.write("GLUE2EndpointServingState: %s\n" % srvState)
    out.write("GLUE2EndpointStartTime: %s\n" % srvStarttime)
    out.write("GLUE2EndpointIssuerCA: %s\n" % hostIssuer)
    for tCA in ServiceInfoUtils.getTrustAnchors():
        out.write("GLUE2EndpointTrustedCA: %s\n" % tCA)

    out.write(
        "GLUE2EndpointDownTimeInfo: See the GOC DB for downtimes: https://goc.egi.eu/\n"
    )
    out.write("GLUE2EndpointServiceForeignKey: %s\n" % siteDefs.compServiceID)

    out.write("GLUE2ComputingEndpointStaging: staginginout\n")
    out.write("GLUE2ComputingEndpointJobDescription: glite:jdl\n")
    out.write("GLUE2ComputingEndpointComputingServiceForeignKey: %s\n" %
              siteDefs.compServiceID)
    out.write("\n")

    out.write("dn: GLUE2PolicyID=%s_Policy,%s\n" % (endPointID, endPointDN))

    out.write("objectClass: GLUE2Entity\n")
    out.write("objectClass: GLUE2Policy\n")
    out.write("objectClass: GLUE2AccessPolicy\n")

    out.write("GLUE2EntityCreationTime: %s\n" % now)
    out.write("GLUE2EntityName: Access control rules for Endpoint %s\n" %
              endPointID)
    out.write("GLUE2EntityOtherInfo: InfoProviderName=%s\n" %
              CommonUtils.providerName)
    out.write("GLUE2EntityOtherInfo: InfoProviderVersion=%s\n" %
              CommonUtils.providerVersion)
    out.write("GLUE2EntityOtherInfo: InfoProviderHost=%s\n" % siteDefs.ceHost)

    out.write("GLUE2PolicyID: %s_Policy\n" % endPointID)
    # The policy scheme needs a name: arbitrarily define this as org.glite.standard
    out.write("GLUE2PolicyScheme: org.glite.standard\n")

    voList = siteDefs.ruleTable.getVOList()
    for voItem in voList:
        out.write('GLUE2PolicyUserDomainForeignKey: %s\n' % voItem.getVOName())
    for voItem in voList:
        out.write('GLUE2PolicyRule: %s\n' % repr(voItem))

    out.write("GLUE2AccessPolicyEndpointForeignKey: %s\n" % endPointID)
    out.write("\n")
コード例 #2
0
def process(siteDefs, out=sys.stdout):

    if siteDefs.clusterStandAloneMode():
        #
        # Endpoint is not available on cluster node alone
        #
        return

    now = CommonUtils.getNow()

    endPointID = siteDefs.ceHost + '_org.glite.ce.CREAM'
    endPointDN = 'GLUE2EndpointID=%s,GLUE2ServiceID=%s,GLUE2GroupID=resource,o=glue' \
                  % (endPointID, siteDefs.compServiceID)
    implVer, ifaceVer = ServiceInfoUtils.getCREAMServiceInfo()
    hostDN, hostIssuer = ServiceInfoUtils.getHostCertInfo()
    #
    # TODO Validity is hard-coded for now (1hour in seconds)
    #
    validity = 3600
    statusCode, statusInfo = ServiceInfoUtils.getTomcatStatus()
    srvState, srvStarttime = ServiceInfoUtils.getCREAMServingState()
    
    out.write("dn: %s\n" % endPointDN)
    
    out.write("objectClass: GLUE2Entity\n")
    out.write("objectClass: GLUE2Endpoint\n")
    out.write("objectClass: GLUE2ComputingEndpoint\n")
    
    out.write("GLUE2EntityName: %s\n" % endPointID)
    out.write("GLUE2EntityCreationTime: %s\n" % now)
    out.write("GLUE2EntityValidity: %d\n" % validity)
    out.write("GLUE2EntityOtherInfo: HostDN=%s\n" % hostDN)
    out.write("GLUE2EntityOtherInfo: InfoProviderName=%s\n" % CommonUtils.providerName)
    out.write("GLUE2EntityOtherInfo: InfoProviderVersion=%s\n" % CommonUtils.providerVersion)
    out.write("GLUE2EntityOtherInfo: InfoProviderHost=%s\n" % siteDefs.ceHost)
    out.write("GLUE2EntityOtherInfo: ArgusEnabled=%s\n" % repr(siteDefs.argusEnabled).upper())
    
    out.write("Glue2EndpointStartTime: %s\n" % now)
    out.write("GLUE2EndpointID: %s\n" % endPointID)
    out.write("GLUE2EndpointURL: https://%s:%d/ce-cream/services\n" % (siteDefs.ceHost, siteDefs.cePort))
    out.write("GLUE2EndpointCapability: executionmanagement.jobexecution\n")
    out.write("GLUE2EndpointTechnology: webservice\n")
    out.write("GLUE2EndpointInterfaceName: org.glite.ce.CREAM\n")
    out.write("GLUE2EndpointInterfaceVersion: %s\n" % ifaceVer)
    out.write("GLUE2EndpointWSDL: https://%s:%d/ce-cream/services/CREAM2?wsdl\n" % (siteDefs.ceHost, siteDefs.cePort))
    out.write("GLUE2EndpointSupportedProfile: http://www.ws-i.org/Profiles/BasicProfile-1.0.html\n")
    out.write("GLUE2EndpointSemantics:http://wiki.italiangrid.org/twiki/bin/view/CREAM/UserGuide\n")
    out.write("GLUE2EndpointImplementor: gLite\n")
    out.write("GLUE2EndpointImplementationName: CREAM\n")
    out.write("GLUE2EndpointImplementationVersion: %s\n" % implVer)
    out.write("GLUE2EndpointQualityLevel: production\n")
    
    out.write("GLUE2EndpointHealthState: %s\n" % statusCode)
    out.write("GLUE2EndpointHealthStateInfo: %s\n" % statusInfo)
    out.write("GLUE2EndpointServingState: %s\n" % srvState)
    out.write("GLUE2EndpointStartTime: %s\n" % srvStarttime)
    out.write("GLUE2EndpointIssuerCA: %s\n" % hostIssuer)
    for tCA in ServiceInfoUtils.getTrustAnchors():
        out.write("GLUE2EndpointTrustedCA: %s\n" % tCA)
    
    out.write("GLUE2EndpointDownTimeInfo: See the GOC DB for downtimes: https://goc.egi.eu/\n")
    out.write("GLUE2EndpointServiceForeignKey: %s\n" % siteDefs.compServiceID)
    
    out.write("GLUE2ComputingEndpointStaging: staginginout\n")
    out.write("GLUE2ComputingEndpointJobDescription: glite:jdl\n")
    out.write("GLUE2ComputingEndpointComputingServiceForeignKey: %s\n" % siteDefs.compServiceID)
    out.write("\n")
    
    
    out.write("dn: GLUE2PolicyID=%s_Policy,%s\n" % (endPointID, endPointDN))

    out.write("objectClass: GLUE2Entity\n")
    out.write("objectClass: GLUE2Policy\n")
    out.write("objectClass: GLUE2AccessPolicy\n")
    
    out.write("GLUE2EntityCreationTime: %s\n" % now)
    out.write("GLUE2EntityName: Access control rules for Endpoint %s\n" % endPointID)
    out.write("GLUE2EntityOtherInfo: InfoProviderName=%s\n" % CommonUtils.providerName)
    out.write("GLUE2EntityOtherInfo: InfoProviderVersion=%s\n" % CommonUtils.providerVersion)
    out.write("GLUE2EntityOtherInfo: InfoProviderHost=%s\n" % siteDefs.ceHost)

    out.write("GLUE2PolicyID: %s_Policy\n" % endPointID)
    # The policy scheme needs a name: arbitrarily define this as org.glite.standard
    out.write("GLUE2PolicyScheme: org.glite.standard\n")
    
    voList = siteDefs.ruleTable.getVOList()
    for voItem in voList:
        out.write('GLUE2PolicyUserDomainForeignKey: %s\n' % voItem.getVOName())
    for voItem in voList:
        out.write('GLUE2PolicyRule: %s\n' % repr(voItem))
        
    out.write("GLUE2AccessPolicyEndpointForeignKey: %s\n" % endPointID)
    out.write("\n")
コード例 #3
0
def process(siteDefs, out=sys.stdout):

    srvType = 'org.glite.ce.CREAM'
    srvID = "%s_%s_%d" % (siteDefs.ceHost, srvType, siteDefs.cePort)
    srvDN = 'dn: GlueServiceUniqueID=%s,mds-vo-name=resource,o=grid' % srvID
    
    out.write('%s\n' % srvDN)
    
    out.write('''objectClass: GlueTop
objectClass: GlueService
objectClass: GlueKey
objectClass: GlueSchemaVersion
''')

    out.write('GlueServiceUniqueID: %s\n' % srvID)
    out.write('GlueServiceName: %s-CREAM\n' % siteDefs.siteName)
    out.write('GlueServiceType: %s\n' % srvType)
    out.write('GlueServiceVersion: %s\n' % ServiceInfoUtils.getCREAMServiceInfo()[0])
    out.write('GlueServiceEndpoint: https://%s:%d/ce-cream/services\n' % (siteDefs.ceHost, siteDefs.cePort))
    
    statusCode, statusInfo = ServiceInfoUtils.getTomcatStatus()
    out.write('GlueServiceStatus: %s\n' % statusCode)
    out.write('GlueServiceStatusInfo: %s\n' % statusInfo)
    
    out.write('GlueServiceWSDL: http://grid.pd.infn.it/cream/wsdl/org.glite.ce-cream_service.wsdl\n')
    out.write('GlueServiceSemantics: https://edms.cern.ch/document/595770\n')
    out.write('GlueServiceStartTime: %s\n' % ServiceInfoUtils.getTomcatStartTime())
    
    voList = siteDefs.ruleTable.getVOList()
    for voItem in voList:
        out.write('GlueServiceOwner: %s\n' % voItem.getVOName())
    for voItem in voList:
        out.write('GlueServiceAccessControlBaseRule: %s\n' % repr(voItem))
        
    out.write('GlueForeignKey: GlueSiteUniqueID=%s\n' % siteDefs.siteName)
    out.write('GlueSchemaVersionMajor: 1\n')
    out.write('GlueSchemaVersionMinor: 3\n')
    out.write('\n')


    srvDataTable = { 'glite-info-service_version' : '1.7',
                     'glite-info-service_hostname' : siteDefs.ceHost,
                     'DN' : ServiceInfoUtils.getHostCertInfo()[0]}
    

    for srvDataItem in srvDataTable:
        
        out.write("dn: GlueServiceDataKey=%s,%s\n" % (srvDataItem, srvDN))
        out.write('''objectClass: GlueTop
objectClass: GlueServiceData
objectClass: GlueKey
objectClass: GlueSchemaVersion
''')

        out.write("GlueServiceDataKey: %s\n" % srvDataItem)
        if isinstance(srvDataTable[srvDataItem], types.ListType):
            for dataItem in srvDataTable[srvDataItem]:
                out.write("GlueServiceDataValue: %s\n" % dataItem)
        else:
            out.write("GlueServiceDataValue: %s\n" % srvDataTable[srvDataItem])
        out.write("GlueChunkKey: GlueServiceUniqueID=%s\n" % srvID)
        out.write("GlueSchemaVersionMajor: 1\n")
        out.write("GlueSchemaVersionMinor: 3\n")
        out.write("\n")
コード例 #4
0
def process(siteDefs, out=sys.stdout):

    for queue in siteDefs.ruleTable.getQueueList(siteDefs.ceHost):
    
        if len(siteDefs.seAccess) > 0:
            bestSE = min(siteDefs.seAccess.values())
        else:
            bestSE = None
    
        glueceDN = 'GlueCEUniqueID=%s:%d/cream-%s-%s,mds-vo-name=resource,o=grid' % \
                   (siteDefs.ceHost, siteDefs.cePort, siteDefs.jobmanager, queue)
        
        glueceID = '%s:%d/cream-%s-%s' % (siteDefs.ceHost, siteDefs.cePort, siteDefs.jobmanager, queue)
    
        out.write('dn:%s\n' % glueceDN)
        
        out.write('''objectClass: GlueCETop
objectClass: GlueCE
objectClass: GlueCEAccessControlBase
objectClass: GlueCEInfo
objectClass: GlueCEPolicy
objectClass: GlueCEState
objectClass: GlueInformationService
objectClass: GlueKey
objectClass: GlueSchemaVersion
''')

        out.write('GlueCEUniqueID: %s\n' % glueceID)
                  
        out.write('GlueCEHostingCluster: %s\n' % siteDefs.ceHost)
        out.write('GlueCEName: %s\n' % queue)
        out.write('GlueCEImplementationName: CREAM\n')
        out.write('GlueCEImplementationVersion: %s\n' % ServiceInfoUtils.getCREAMServiceInfo()[0])
        for capa in siteDefs.capabilities:
            out.write('GlueCECapability: %s\n' % capa)
            
        for acbr in siteDefs.ruleTable.getVOList(siteDefs.ceHost, queue):
            out.write('GlueCEAccessControlBaseRule: %s\n' % repr(acbr))
        
        out.write('GlueCEInfoGatekeeperPort: %d\n' % siteDefs.cePort)
        out.write('GlueCEInfoHostName: %s\n' % siteDefs.ceHost)
        out.write('GlueCEInfoLRMSType: %s\n' % siteDefs.batchsys)
        #TODO investigate LRMSVersion
        out.write('GlueCEInfoLRMSVersion: not defined\n')
        out.write('GlueCEInfoTotalCPUs: 0\n')
        out.write('GlueCEInfoJobManager: %s\n' % siteDefs.jobmanager)
        out.write('GlueCEInfoContactString: https://%s:%d/ce-cream/services\n' % (siteDefs.ceHost, siteDefs.cePort))
        if siteDefs.softDir and len(siteDefs.softDir) > 0:
            out.write('GlueCEInfoApplicationDir: %s\n' % siteDefs.softDir)
        if siteDefs.ceDataDir and len(siteDefs.ceDataDir) > 0:
            out.write('GlueCEInfoDataDir: %s\n' % siteDefs.ceDataDir)
        if bestSE <> None:
            out.write('GlueCEInfoDefaultSE: %s\n' % bestSE.host)
            
        out.write('GlueCEStateEstimatedResponseTime: %d\n' % MAX_RESPONSE_TIME)
        out.write('GlueCEStateWorstResponseTime: %d\n' % MAX_RESPONSE_TIME)
        out.write('GlueCEStateFreeCPUs: 0\n')
        out.write('GlueCEStateRunningJobs: 0\n')
        out.write('GlueCEStateStatus: Unknown\n')
        out.write('GlueCEStateTotalJobs: 0\n')
        out.write('GlueCEStateWaitingJobs: %d\n' % MAX_JOB_NUMBER)
        out.write('GlueCEStateFreeJobSlots: 0\n')
        
        out.write('GlueCEPolicyMaxRunningJobs: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxTotalJobs: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxCPUTime: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxWallClockTime: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxObtainableCPUTime: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxObtainableWallClockTime: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxWaitingJobs: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxSlotsPerJob: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyPreemption: 0\n')
        out.write('GlueCEPolicyPriority: 1\n')
        out.write('GlueCEPolicyAssignedJobSlots: 0\n')
        
        out.write('GlueForeignKey: GlueClusterUniqueID=%s\n' % siteDefs.ceHost)
        out.write('GlueInformationServiceURL: ldap://%s:2170/mds-vo-name=resource,o=grid\n' % siteDefs.ceHost)
        out.write('GlueSchemaVersionMajor: 1\n')
        out.write('GlueSchemaVersionMinor: 3\n')
        out.write('\n')

    
        for vogrp in siteDefs.ruleTable.getVOList(siteDefs.ceHost, queue):
            
            voviewID = vogrp.getNormName()
            voName = vogrp.getVOName()
            
            out.write("dn:GlueVOViewLocalID=%s,%s\n" % (voviewID, glueceDN))
            
            out.write('''objectClass: GlueCETop
objectClass: GlueVOView
objectClass: GlueCEInfo
objectClass: GlueCEState
objectClass: GlueCEAccessControlBase
objectClass: GlueCEPolicy
objectClass: GlueKey
objectClass: GlueSchemaVersion
''')
            out.write('GlueVOViewLocalID: %s\n' % voviewID)
            out.write('GlueCEStateRunningJobs: 0\n')
            out.write('GlueCEStateWaitingJobs: %d\n' % MAX_JOB_NUMBER)
            out.write('GlueCEStateTotalJobs: 0\n')
            out.write('GlueCEStateFreeJobSlots: 0\n')
            out.write('GlueCEStateEstimatedResponseTime: %d\n' % MAX_RESPONSE_TIME)
            out.write('GlueCEStateWorstResponseTime: %d\n' % MAX_RESPONSE_TIME)
            
            tmpSE = None
            tmpSDir = None
            
            if voName in siteDefs.voParams:
                tmpSE = siteDefs.voParams[voName].defaultSE
                tmpSDir = siteDefs.voParams[voName].softDir
                
            if not tmpSE and bestSE <> None:
                tmpSE = bestSE.host
            
            if not tmpSDir:
                tmpSDir = siteDefs.softDir
                
            if tmpSE:
                out.write('GlueCEInfoDefaultSE: %s\n' % tmpSE)
            if tmpSDir:
                out.write('GlueCEInfoApplicationDir: %s\n' % tmpSDir)

            if siteDefs.ceDataDir and len(siteDefs.ceDataDir) > 0:
                out.write('GlueCEInfoDataDir: %s\n' % siteDefs.ceDataDir)
                
            out.write('GlueChunkKey: GlueCEUniqueID=%s\n' % glueceID)
            out.write('GlueCEAccessControlBaseRule: %s\n' % repr(vogrp))
            out.write('GlueSchemaVersionMajor: 1\n')
            out.write('GlueSchemaVersionMinor: 3\n')
            out.write('\n')
コード例 #5
0
def process(siteDefs, out=sys.stdout):

    for queue in siteDefs.ruleTable.getQueueList(siteDefs.ceHost):

        if len(siteDefs.seAccess) > 0:
            bestSE = min(siteDefs.seAccess.values())
        else:
            bestSE = None

        glueceDN = 'GlueCEUniqueID=%s:%d/cream-%s-%s,mds-vo-name=resource,o=grid' % \
                   (siteDefs.ceHost, siteDefs.cePort, siteDefs.jobmanager, queue)

        glueceID = '%s:%d/cream-%s-%s' % (siteDefs.ceHost, siteDefs.cePort,
                                          siteDefs.jobmanager, queue)

        out.write('dn:%s\n' % glueceDN)

        out.write('''objectClass: GlueCETop
objectClass: GlueCE
objectClass: GlueCEAccessControlBase
objectClass: GlueCEInfo
objectClass: GlueCEPolicy
objectClass: GlueCEState
objectClass: GlueInformationService
objectClass: GlueKey
objectClass: GlueSchemaVersion
''')

        out.write('GlueCEUniqueID: %s\n' % glueceID)

        out.write('GlueCEHostingCluster: %s\n' % siteDefs.ceHost)
        out.write('GlueCEName: %s\n' % queue)
        out.write('GlueCEImplementationName: CREAM\n')
        out.write('GlueCEImplementationVersion: %s\n' %
                  ServiceInfoUtils.getCREAMServiceInfo()[0])
        for capa in siteDefs.capabilities:
            out.write('GlueCECapability: %s\n' % capa)

        for acbr in siteDefs.ruleTable.getVOList(siteDefs.ceHost, queue):
            out.write('GlueCEAccessControlBaseRule: %s\n' % repr(acbr))

        out.write('GlueCEInfoGatekeeperPort: %d\n' % siteDefs.cePort)
        out.write('GlueCEInfoHostName: %s\n' % siteDefs.ceHost)
        out.write('GlueCEInfoLRMSType: %s\n' % siteDefs.batchsys)
        #TODO investigate LRMSVersion
        out.write('GlueCEInfoLRMSVersion: not defined\n')
        out.write('GlueCEInfoTotalCPUs: 0\n')
        out.write('GlueCEInfoJobManager: %s\n' % siteDefs.jobmanager)
        out.write(
            'GlueCEInfoContactString: https://%s:%d/ce-cream/services\n' %
            (siteDefs.ceHost, siteDefs.cePort))
        if siteDefs.softDir and len(siteDefs.softDir) > 0:
            out.write('GlueCEInfoApplicationDir: %s\n' % siteDefs.softDir)
        if siteDefs.ceDataDir and len(siteDefs.ceDataDir) > 0:
            out.write('GlueCEInfoDataDir: %s\n' % siteDefs.ceDataDir)
        if bestSE <> None:
            out.write('GlueCEInfoDefaultSE: %s\n' % bestSE.host)

        out.write('GlueCEStateEstimatedResponseTime: %d\n' % MAX_RESPONSE_TIME)
        out.write('GlueCEStateWorstResponseTime: %d\n' % MAX_RESPONSE_TIME)
        out.write('GlueCEStateFreeCPUs: 0\n')
        out.write('GlueCEStateRunningJobs: 0\n')
        out.write('GlueCEStateStatus: Unknown\n')
        out.write('GlueCEStateTotalJobs: 0\n')
        out.write('GlueCEStateWaitingJobs: %d\n' % MAX_JOB_NUMBER)
        out.write('GlueCEStateFreeJobSlots: 0\n')

        out.write('GlueCEPolicyMaxRunningJobs: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxTotalJobs: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxCPUTime: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxWallClockTime: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxObtainableCPUTime: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxObtainableWallClockTime: %d\n' %
                  MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxWaitingJobs: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyMaxSlotsPerJob: %d\n' % MAX_POLICY_NUMBER)
        out.write('GlueCEPolicyPreemption: 0\n')
        out.write('GlueCEPolicyPriority: 1\n')
        out.write('GlueCEPolicyAssignedJobSlots: 0\n')

        out.write('GlueForeignKey: GlueClusterUniqueID=%s\n' % siteDefs.ceHost)
        out.write(
            'GlueInformationServiceURL: ldap://%s:2170/mds-vo-name=resource,o=grid\n'
            % siteDefs.ceHost)
        out.write('GlueSchemaVersionMajor: 1\n')
        out.write('GlueSchemaVersionMinor: 3\n')
        out.write('\n')

        for vogrp in siteDefs.ruleTable.getVOList(siteDefs.ceHost, queue):

            voviewID = vogrp.getNormName()
            voName = vogrp.getVOName()

            out.write("dn:GlueVOViewLocalID=%s,%s\n" % (voviewID, glueceDN))

            out.write('''objectClass: GlueCETop
objectClass: GlueVOView
objectClass: GlueCEInfo
objectClass: GlueCEState
objectClass: GlueCEAccessControlBase
objectClass: GlueCEPolicy
objectClass: GlueKey
objectClass: GlueSchemaVersion
''')
            out.write('GlueVOViewLocalID: %s\n' % voviewID)
            out.write('GlueCEStateRunningJobs: 0\n')
            out.write('GlueCEStateWaitingJobs: %d\n' % MAX_JOB_NUMBER)
            out.write('GlueCEStateTotalJobs: 0\n')
            out.write('GlueCEStateFreeJobSlots: 0\n')
            out.write('GlueCEStateEstimatedResponseTime: %d\n' %
                      MAX_RESPONSE_TIME)
            out.write('GlueCEStateWorstResponseTime: %d\n' % MAX_RESPONSE_TIME)

            tmpSE = None
            tmpSDir = None

            if voName in siteDefs.voParams:
                tmpSE = siteDefs.voParams[voName].defaultSE
                tmpSDir = siteDefs.voParams[voName].softDir

            if not tmpSE and bestSE <> None:
                tmpSE = bestSE.host

            if not tmpSDir:
                tmpSDir = siteDefs.softDir

            if tmpSE:
                out.write('GlueCEInfoDefaultSE: %s\n' % tmpSE)
            if tmpSDir:
                out.write('GlueCEInfoApplicationDir: %s\n' % tmpSDir)

            if siteDefs.ceDataDir and len(siteDefs.ceDataDir) > 0:
                out.write('GlueCEInfoDataDir: %s\n' % siteDefs.ceDataDir)

            out.write('GlueChunkKey: GlueCEUniqueID=%s\n' % glueceID)
            out.write('GlueCEAccessControlBaseRule: %s\n' % repr(vogrp))
            out.write('GlueSchemaVersionMajor: 1\n')
            out.write('GlueSchemaVersionMinor: 3\n')
            out.write('\n')