def __init__(self, conf, job_params, logger=None): super(Meta2RebuildTask, self).__init__( conf, job_params, logger=logger) self.meta2_id = job_params['service_id'] self.meta2 = Meta2Database(conf, logger=logger)
def setUp(self): super(TestMeta2Database, self).setUp() self.api = ObjectStorageApi(self.ns) self.account = "test_meta2_database" self.reference = "meta2_database_" + random_str(4) self.meta2_database = Meta2Database(self.conf) self.service_type = 'meta2'
def __init__(self, conf, job_params, logger=None): super(Meta2DecommissionTask, self).__init__( conf, job_params, logger=logger) self.src = job_params['service_id'] self.dst = job_params['dst'] self.meta2 = Meta2Database(conf, logger=logger)
def test_move_sqlx(self): self.meta2_database = Meta2Database(self.conf, service_type='sqlx') self.service_type = 'sqlx' execute('oio-sqlx -O AutoCreate %s/%s/%s ' '"create table foo (a INT, b TEXT)"' % (self.ns, self.account, self.reference)) self._test_move()
def _run(self, parsed_args): meta2 = Meta2Database(self.app.client_manager.client_conf, logger=self.log) for container in parsed_args.containers: if parsed_args.is_cid: cid = container else: cid = cid_from_name(self.app.options.account, container) moved = meta2.move(cid, parsed_args.src, dst=parsed_args.dst) for res in moved: res['container'] = container yield res
def __init__(self, tool, queue_workers, queue_reply): super(ContainerRepairerWorker, self).__init__( tool, queue_workers, queue_reply) self.rebuild_bases = true_value(self.tool.conf.get( 'rebuild_bases', self.tool.DEFAULT_REBUILD_BASES)) self.sync_bases = true_value(self.tool.conf.get( 'sync_bases', self.tool.DEFAULT_SYNC_BASES)) self.update_account = true_value(self.tool.conf.get( 'update_account', self.tool.DEFAULT_UPDATE_ACCOUNT)) self.admin_client = AdminClient(self.conf, logger=self.logger) self.container_client = ContainerClient(self.conf, logger=self.logger) self.meta2_database = Meta2Database(self.conf, logger=self.logger)
def _take_action(self, parsed_args): containers = self.resolve_containers(self.app, parsed_args) meta2 = Meta2Database(self.app.client_manager.client_conf, logger=self.logger) for _, container_name, container_id in containers: moved = meta2.move(container_id, parsed_args.src, dst=parsed_args.dst) for res in moved: if res['err'] is None: status = 'OK' else: self.success = False status = 'error' yield (container_name, res['base'], res['src'], res['dst'], status, res['err'])
def __init__(self, tool, queue_workers, queue_reply): super(ContentRepairerWorker, self).__init__(tool, queue_workers, queue_reply) self.admin_client = AdminClient(self.conf, logger=self.logger) self.meta2_database = Meta2Database(self.conf, logger=self.logger)