예제 #1
0
    def __init__(self) :

        super(test, self).__init__()

        self.maindir = '/data/files/dropBoxBE/'

        # For development, we use the prep dropBox database
        if service.settings['productionLevel'] in set(['dev']):
            self.backend = 'dev'
            self.destinationDB = 'oracle://cms_orcoff_prep/CMS_COND_DROPBOX'
            self.authpath = '/afs/cern.ch/cms/DB/conddb/test/dropbox'

        # In private instances, we take it from netrc
        elif service.settings['productionLevel'] in set(['private']):
            self.backend = 'private'
            connectionDictionary = service.getConnectionDictionaryFromNetrc('dropBoxDatabase')
            self.destinationDB = 'oracle://%s/%s' % (connectionDictionary['db_name'], connectionDictionary['user'])
            # will be pointing to the location where the tester is keeping his test_dropbox key
            # should become obsolete with new authentication
            self.authpath = '/data/secrets'

        else:
            raise Exception('Unknown production level.')

        # this is the URL for the dropBox frontend service, for testing/developing use the current host:
        self.baseUrl = 'https://%s/dropBox/' % (socket.gethostname(),)

        # be quicker in tests
        self.delay = 10

        #  used for sync to express and hlt
        self.runInfoDbName = "oracle://cms_orcon_adg/CMS_COND_31X_RUN_INFO"  # ... in online (and cms_orcon_adg in offline)
        self.runInfotag = "runinfo_start_31X_hlt"

        # this will later go into the main DB:
        self.logdb = 'sqlite_file:/tmp/TestOfflineDropBoxJobLog.db'

        self.gtDbName = "oracle://cms_orcon_adg/CMS_COND_31X_GLOBALTAG"
        self.gtTags = {'hlt' : 'GR10_H_V5', 'express' : 'GR10_E_V5',
                       'prompt' : 'GR10_P_V5'} #-ap: get this from gtList (if we can)

        self.debug = True
예제 #2
0
              log:

{{log}}
''' % subjectLine)

# For integration and production, we use the production dropBox database
if service.settings['productionLevel'] in set(['int', 'pro']):
    connectionDictionary = service.secrets['connections']['pro']

# For development, we use the prep dropBox database
elif service.settings['productionLevel'] in set(['dev']):
    connectionDictionary = service.secrets['connections']['dev']

# In private instances, we take it from netrc
elif service.settings['productionLevel'] in set(['private']):
    connectionDictionary = service.getConnectionDictionaryFromNetrc(
        'dropBoxDatabase')

else:
    raise Exception('Unknown production level.')

# Allowed backends per production level
allowedBackends = {
    'private': set(['private']),
    'dev': set(['dev']),
    'int': set(['offline', 'online', 'tier0']),
    'pro': set(['offline', 'online', 'tier0']),
}

# Allowed services (i.e. databases) per backend
#
# None means 'same as the dropBox connectionString above', i.e. the user's
예제 #3
0

import service


# For integration and production, we use the (reader) production dropBox database
if service.settings['productionLevel'] in set(['int', 'pro']):
    connectionDictionary = service.secrets['dropBoxConnections']['pro']

# For development, we use the prep dropBox database
elif service.settings['productionLevel'] in set(['dev']):
    connectionDictionary = service.secrets['dropBoxConnections']['dev']

# In private instances, we take connections from netrc
elif service.settings['productionLevel'] in set(['private']):
    connectionDictionary = service.getConnectionDictionaryFromNetrc('dropBoxDatabase')

else:
    raise Exception('Unknown production level.')


def getBackendOldThreshold(backend):

    backendsOldThreshold = {
        # Online and offline backends run every 30 seconds, so 60 seconds should note a problem
        'online': 60,
        'offline': 60,

        # Tier0 backend runs at 10-min boundaries, so 20 minutes should note a problem
        'tier0': 20 * 60,