Example #1
0
def initGC():
	import os, sys
	basePath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
	sys.path.insert(1, basePath) # packages bundled with grid-control have priority
	os.environ['GC_PACKAGES_PATH'] = basePath # Store grid-control base path in enviroment variable
	from hpfwk import init_hpf_plugins
	from grid_control.logging_setup import logging_defaults
	init_hpf_plugins(basePath)
	logging_defaults()
Example #2
0
def initGC():
	import os, sys
	basePath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
	sys.path.insert(1, basePath) # packages bundled with grid-control have priority
	os.environ['GC_PACKAGES_PATH'] = basePath # Store grid-control base path in enviroment variable
	from hpfwk import init_hpf_plugins
	from grid_control.logging_setup import logging_defaults
	init_hpf_plugins(basePath)
	logging_defaults()
Example #3
0
def _init_grid_control():
	if not _init_grid_control.flag:
		_init_grid_control.flag = True
		import os, sys
		packages_base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
		sys.path.insert(1, packages_base_path)  # packages bundled with grid-control have priority
		os.environ['GC_PACKAGES_PATH'] = packages_base_path  # Store grid-control base path

		from hpfwk import init_hpf_plugins
		package_name_list = os.listdir(packages_base_path)
		package_name_list.sort()
		for package_name in package_name_list:
			init_hpf_plugins(os.path.join(packages_base_path, package_name))

		from grid_control.logging_setup import logging_defaults
		logging_defaults()
Example #4
0
def _init_grid_control():
    if not _init_grid_control.flag:
        _init_grid_control.flag = True
        import os, sys
        packages_base_path = os.path.dirname(
            os.path.dirname(os.path.abspath(__file__)))
        sys.path.insert(1, packages_base_path
                        )  # packages bundled with grid-control have priority
        os.environ[
            'GC_PACKAGES_PATH'] = packages_base_path  # Store grid-control base path

        from hpfwk import init_hpf_plugins
        package_name_list = os.listdir(packages_base_path)
        package_name_list.sort()
        for package_name in package_name_list:
            init_hpf_plugins(os.path.join(packages_base_path, package_name))

        from grid_control.logging_setup import logging_defaults
        logging_defaults()
Example #5
0
def _run_test():
	from grid_control.logging_setup import logging_defaults
	logging_defaults()
	logger = logging.getLogger('dbs3-migration')

	block_names = ['test1', 'test1', 'test2', 'test3', 'test4']
	migration_queue = DBS3MigrationQueue()

	for block in block_names:
		try:
			migration_queue.add_migration_task(MigrationTask(block_name=block,
				migration_url='http://a.b.c', dbs_client=None))
		except AlreadyQueued:
			logger.exception('Already queued')
			clear_current_exception()

	migration_queue.save_to_disk('test.pkl')
	del migration_queue
	new_migration_queue = DBS3MigrationQueue.read_from_disk('test.pkl')
	do_migration(new_migration_queue)