Пример #1
0
def main():
    if service.isAnotherInstanceRunning():
        logging.info('Another instance is running, exiting...')
        return

    if service.settings['productionLevel'] in ['dev', 'int']:
        logging.info('Disabled in %s since the DB will be updated by Dimitar.', service.settings['productionLevel'])
        return

    subprocess.call('python src/manage.py global_update', shell=True)
Пример #2
0
def main():
    if service.isAnotherInstanceRunning():
        logging.info('Another instance is running, exiting...')
        return

    if service.settings['productionLevel'] != 'private':
        logging.info('This script is only meant for private deployments.')
        return

    subprocess.call('python src/manage.py initial_global_update', shell=True)
Пример #3
0
def main():
    if service.isAnotherInstanceRunning():
        logging.info('Another instance is running, exiting...')
        return

    if service.settings['productionLevel'] in ['dev', 'int']:
        logging.info('Disabled in %s since the DB will be updated by Dimitar.',
                     service.settings['productionLevel'])
        return

    subprocess.call('python src/manage.py global_update', shell=True)
Пример #4
0
def main():
    if service.isAnotherInstanceRunning():
        logging.info('Another instance is running, exiting...')
        return

    connections = service.secrets['connections']

    i = 0
    for level in connections:
        i += 1

        connectionStrings = service.getFrontierConnectionStringList(
            connections[level])

        j = 0
        for connectionString in connectionStrings:
            j += 1

            shortConnectionString = service.getFrontierConnectionString(
                {
                    'account': connections[level]['accounts'][j - 1],
                    'frontier_name': connections[level]['frontier_name']
                },
                short=True)

            loggingPrefix = '[%s/%s %s %s/%s] %s: ' % (
                i, len(connections), level, j, len(connectionStrings),
                connectionString.rsplit('/', 1)[1])

            try:
                logging.info(loggingPrefix + 'Building HTML...')
                LastIOVSince(dbName=connectionString).writeTable(
                    dbName=shortConnectionString)
            except Exception as e:
                logging.error(loggingPrefix +
                              'Exception while building HTML: %s.' % str(e))

            try:
                logging.info(loggingPrefix + 'Building JSON...')
                condDB = EcalCondDB(dbName=connectionString)
                condDB.listContainers_json_writer(
                    content=condDB.listContainers(),
                    dbName=shortConnectionString)
            except Exception as e:
                logging.error(loggingPrefix +
                              'Exception while building JSON: %s.' % str(e))
Пример #5
0
def main():
	if service.isAnotherInstanceRunning():
		logging.info('Another instance is running, exiting...')
		return

	connections = service.secrets['connections']

	i = 0
	for level in connections:
		i += 1

		connectionStrings = service.getFrontierConnectionStringList(connections[level])

		j = 0
		for connectionString in connectionStrings:
			j += 1

			shortConnectionString = service.getFrontierConnectionString({
				'account': connections[level]['accounts'][j-1],
				'frontier_name': connections[level]['frontier_name']
			}, short = True)

			loggingPrefix = '[%s/%s %s %s/%s] %s: ' % (i, len(connections), level, j, len(connectionStrings), connectionString.rsplit('/', 1)[1])

			try:
				logging.info(loggingPrefix + 'Building HTML...')
				LastIOVSince(dbName = connectionString).writeTable(dbName = shortConnectionString)
			except Exception as e:
				logging.error(loggingPrefix + 'Exception while building HTML: %s.' % str(e))

			try:
				logging.info(loggingPrefix + 'Building JSON...')
				condDB = EcalCondDB(dbName = connectionString)
				condDB.listContainers_json_writer(content = condDB.listContainers(), dbName = shortConnectionString)
			except Exception as e:
				logging.error(loggingPrefix + 'Exception while building JSON: %s.' % str(e))