Esempio n. 1
0
 def __init__(self):
     try:
         self.host_manager = driver.DriverManager(
             "jacket.compute.scheduler.host_manager",
             CONF.compute_scheduler_host_manager,
             invoke_on_load=True).driver
     # TODO(Yingxin): Change to catch stevedore.exceptions.NoMatches
     # after stevedore v1.9.0
     except RuntimeError:
         # NOTE(Yingxin): Loading full class path is deprecated and
         # should be removed in the N release.
         try:
             self.host_manager = importutils.import_object(
                 CONF.compute_scheduler_host_manager)
             LOG.warning(
                 _LW("DEPRECATED: compute_scheduler_host_manager uses "
                     "classloader to load %(path)s. This legacy "
                     "loading style will be removed in the "
                     "N release."),
                 {'path': CONF.compute_scheduler_host_manager})
         except (ImportError, ValueError):
             raise RuntimeError(
                 _("Cannot load host manager from configuration "
                   "compute_scheduler_host_manager = %(conf)s."),
                 {'conf': CONF.compute_scheduler_host_manager})
     self.servicegroup_api = servicegroup.API()
Esempio n. 2
0
    def __init__(self, cell_state_cls=None):
        super(CellStateManager, self).__init__()
        if not cell_state_cls:
            cell_state_cls = CellState
        self.cell_state_cls = cell_state_cls
        self.my_cell_state = cell_state_cls(CONF.cells.name, is_me=True)
        self.parent_cells = {}
        self.child_cells = {}
        self.last_cell_db_check = datetime.datetime.min
        self.servicegroup_api = servicegroup.API()

        attempts = 0
        while True:
            try:
                self._cell_data_sync(force=True)
                break
            except db_exc.DBError:
                attempts += 1
                if attempts > 120:
                    raise
                LOG.exception(_LE('DB error'))
                time.sleep(30)

        my_cell_capabs = {}
        for cap in CONF.cells.capabilities:
            name, value = cap.split('=', 1)
            if ';' in value:
                values = set(value.split(';'))
            else:
                values = set([value])
            my_cell_capabs[name] = values
        self.my_cell_state.update_capabilities(my_cell_capabs)
Esempio n. 3
0
 def __init__(self):
     super(ComputeTaskManager, self).__init__()
     self.compute_rpcapi = compute_rpcapi.ComputeAPI()
     self.image_api = image.API()
     self.network_api = network.API()
     self.servicegroup_api = servicegroup.API()
     self.scheduler_client = scheduler_client.SchedulerClient()
     self.notifier = rpc.get_notifier('compute', CONF.host)
Esempio n. 4
0
 def __init__(self):
     self.host_api = cloud.HostAPI()
     self.servicegroup_api = servicegroup.API()
     self.actions = {
         "enable": self._enable,
         "disable": self._disable,
         "disable-log-reason": self._disable_log_reason
     }
Esempio n. 5
0
 def __init__(self):
     super(LocalManager, self).__init__()
     # NOTE(vish): setting the host to none ensures that the actual
     #             l3driver commands for l3 are done via rpc.
     self.host = None
     self.servicegroup_api = servicegroup.API()
     self.network_rpcapi = network_rpcapi.NetworkAPI()
     self.floating_dns_manager = importutils.import_object(
         CONF.floating_ip_dns_manager)
     self.instance_dns_manager = importutils.import_object(
         CONF.instance_dns_manager)
     self.notifier = rpc.get_notifier('network', CONF.host)
Esempio n. 6
0
 def __init__(self, host, binary, topic, manager, report_interval=None,
              periodic_enable=None, periodic_fuzzy_delay=None,
              periodic_interval_max=None, db_allowed=True,
              *args, **kwargs):
     super(Service, self).__init__()
     self.host = host
     self.binary = binary
     self.topic = topic
     self.manager_class_name = manager
     self.servicegroup_api = servicegroup.API()
     manager_class = importutils.import_class(self.manager_class_name)
     self.manager = manager_class(host=self.host, *args, **kwargs)
     self.rpcserver = None
     self.report_interval = report_interval
     self.periodic_enable = periodic_enable
     self.periodic_fuzzy_delay = periodic_fuzzy_delay
     self.periodic_interval_max = periodic_interval_max
     self.saved_args, self.saved_kwargs = args, kwargs
     self.backdoor_port = None
     self.conductor_api = conductor.API(use_local=db_allowed)
     self.conductor_api.wait_until_ready(context.get_admin_context())
Esempio n. 7
0
 def __init__(self):
     super(AvailabilityZoneController, self).__init__()
     self.servicegroup_api = servicegroup.API()
Esempio n. 8
0
 def __init__(self):
     self.host_api = cloud.HostAPI()
     self.servicegroup_api = servicegroup.API()
     super(HypervisorsController, self).__init__()
Esempio n. 9
0
 def __init__(self):
     self.servicegroup_api = servicegroup.API()