Exemple #1
0
    def init_processor(self, worker, nova_client_factory=None):
        super(SnapshotProcessor, self).init_processor(worker)
        self.current_job = None
        self.max_retry = CONF.snapshot_worker.max_retry
        self.timeout_count = 0
        self.timeout_max_updates = CONF.snapshot_worker.job_timeout_max_updates
        self.next_timeout = None
        self.timeout_extension = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_extension_sec)
        self.extension_threshold = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_extension_threshold_sec)
        self.update_interval = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_update_interval_sec)
        self.initial_timeout = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_initial_value_sec)
        self.image_poll_interval = CONF.snapshot_worker.image_poll_interval_sec
        self.timeout_backoff_increment = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_backoff_increment_sec)
        self.timeout_backoff_factor = (CONF.snapshot_worker
                                       .job_timeout_backoff_factor)
        self.timeout_worker_stop = datetime.timedelta(
            CONF.snapshot_worker.job_timeout_worker_stop_sec)

        if not nova_client_factory:
            nova_client_factory = importutils.import_object(
                CONF.snapshot_worker.nova_client_factory_class)
        self.nova_client_factory = nova_client_factory
Exemple #2
0
    def init_processor(self, worker, nova_client_factory=None):
        super(SnapshotProcessor, self).init_processor(worker)
        self.current_job = None
        self.max_retry = CONF.snapshot_worker.max_retry
        self.timeout_count = 0
        self.timeout_max_updates = CONF.snapshot_worker.job_timeout_max_updates
        self.next_timeout = None
        self.timeout_extension = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_extension_sec)
        self.extension_threshold = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_extension_threshold_sec)
        self.update_interval = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_update_interval_sec)
        self.initial_timeout = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_initial_value_sec)
        self.image_poll_interval = CONF.snapshot_worker.image_poll_interval_sec
        self.timeout_backoff_increment = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_backoff_increment_sec)
        self.timeout_backoff_factor = (
            CONF.snapshot_worker.job_timeout_backoff_factor)
        self.timeout_worker_stop = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_timeout_worker_stop_sec)

        if not nova_client_factory:
            nova_client_factory = importutils.import_object(
                CONF.snapshot_worker.nova_client_factory_class)
        self.nova_client_factory = nova_client_factory
Exemple #3
0
    def __init__(self, client_factory, processor=None):
        self.client = client_factory(CONF.worker.api_endpoint,
                                     CONF.worker.api_port)
        if not processor:
            processor = importutils.import_object(CONF.worker.processor_class)

        self.processor = processor
        self.worker_id = None
        self.host = socket.gethostname()
Exemple #4
0
    def __init__(self, client_factory, processor=None):
        self.client = client_factory(CONF.worker.api_endpoint,
                                     CONF.worker.api_port)
        if not processor:
            processor = importutils.import_object(CONF.worker.processor_class)

        self.processor = processor
        self.worker_id = None
        self.host = socket.gethostname()
        self.running = False
        self.pid = None
Exemple #5
0
    def init_processor(self, worker, nova_client_factory=None):
        super(SnapshotProcessor, self).init_processor(worker)
        self.current_job = None
        self.timeout_count = 0
        self.timeout_max_updates = CONF.snapshot_worker.job_timeout_max_updates
        self.next_timeout = None
        self.update_interval = datetime.timedelta(seconds=CONF.snapshot_worker.job_update_interval_sec)
        self.timeout_increment = datetime.timedelta(minutes=CONF.snapshot_worker.job_timeout_update_increment_min)
        self.image_poll_interval = CONF.snapshot_worker.image_poll_interval_sec

        if not nova_client_factory:
            nova_client_factory = importutils.import_object(CONF.snapshot_worker.nova_client_factory_class)
        self.nova_client_factory = nova_client_factory
Exemple #6
0
    def init_processor(self, worker, nova_client_factory=None):
        super(SnapshotProcessor, self).init_processor(worker)
        self.current_job = None
        self.timeout_count = 0
        self.timeout_max_updates = CONF.snapshot_worker.job_timeout_max_updates
        self.next_timeout = None
        self.update_interval = datetime.timedelta(
            seconds=CONF.snapshot_worker.job_update_interval_sec)
        self.timeout_increment = datetime.timedelta(
            minutes=CONF.snapshot_worker.job_timeout_update_increment_min)
        self.image_poll_interval = CONF.snapshot_worker.image_poll_interval_sec
        self.job_timeout_backoff_factor = (
            CONF.snapshot_worker.job_timeout_backoff_factor)

        if not nova_client_factory:
            nova_client_factory = importutils.import_object(
                CONF.snapshot_worker.nova_client_factory_class)
        self.nova_client_factory = nova_client_factory
Exemple #7
0
def _get_matchmaker(*args, **kwargs):
    global matchmaker
    if not matchmaker:
        matchmaker = importutils.import_object(CONF.rpc_zmq_matchmaker, *args, **kwargs)
    return matchmaker
Exemple #8
0
def _get_matchmaker(*args, **kwargs):
    global matchmaker
    if not matchmaker:
        matchmaker = importutils.import_object(CONF.rpc_zmq_matchmaker, *args,
                                               **kwargs)
    return matchmaker