Пример #1
0
def VerifyQueuedata(verified):
    """verify the information received from the server throught the queuedata info
    """

    if not verified:
        print "Did not download queuedata from server"
    else:
        # is the site online?
        si = SiteInformation()
        status = si.readpar('status')
        if status.upper() == "OFFLINE":
            print "Site is %s, ignore" % (status.upper())
            # sys.exit(2)
        else:
            print "Site is", status
Пример #2
0
def getWorkdir():
    """obtaining the working directory
    """

    si = SiteInformation()
    getworkdir = si.readpar('wntmpdir')

    ## If workdir contains env var, translate it
    pat = re.compile('(.*)(\$[^\/]+)(.*)')
    mat = pat.match(getworkdir)
    if mat:
        envvar = mat.group(2)
        envvar = envvar.replace('$','')
        if os.environ.has_key(envvar):
            envval = os.environ[envvar]
            getworkdir = "%s%s%s" % ( mat.group(1), envval, mat.group(3) )
            print "Translated wntmpdir with env var to", getworkdir
        else:
            print "WARNING: wntmpdir contains env var %s that is undefined" % envvar
 
    return getworkdir
Пример #3
0
            _dir = '/etc/grid-security/certificates'
            if os.path.exists(_dir):
                sslCertificatesDirectory = _dir
            else:
                tolog("!!WARNING!!2999!! $X509_CERT_DIR is not set and default location %s does not exist" % (_dir))

        return sslCertificatesDirectory

    def getProperPaths(self):
        """ Return proper paths for the storage element """

        # Implement in sub-class

        return ""

    def getTier1Queue(self, cloud):
        """ Download the queuedata for the Tier-1 in the corresponding cloud and get the queue name """

        # Implement in sub-class
        # This method is used during stage-out to alternative [Tier-1] site when primary stage-out on a Tier-2 fails
        # See methods in ATLASSiteInformation

        return None

if __name__ == "__main__":
    from SiteInformation import SiteInformation
    import os
    os.environ['PilotHomeDir'] = os.getcwd()
    s1 = SiteInformation()
    print "copytool=",s1.readpar('copytool')