コード例 #1
0
ファイル: config.py プロジェクト: devcamcar/heat
 def __init__(self, default_config_files=None, **kwargs):
     super(HeatConfigOpts, self).__init__(
         project='heat',
         version='%%prog %s' % version.version_string(),
         default_config_files=default_config_files,
         **kwargs)
     self.register_cli_opts(rpc_opts)
コード例 #2
0
    def start(self):
        vcs_string = version.version_string(type='long')
        LOG.info(_('Starting %(topic)s node (version %(vcs_string)s)'), {
            'topic': self.topic,
            'vcs_string': vcs_string
        })
        # TODO do we need this ? -> utils.cleanup_file_locks()
        self.manager.init_host()
        self.model_disconnected = False
        ctxt = context.get_admin_context()
        # self._create_service_ref(ctxt)

        self.conn = rpc.create_connection(new=True)
        LOG.debug(
            _("Creating Consumer connection for Service %s") % self.topic)

        rpc_dispatcher = self.manager.create_rpc_dispatcher()

        # Share this same connection for these Consumers
        self.conn.create_consumer(self.topic, rpc_dispatcher, fanout=False)

        node_topic = '%s.%s' % (self.topic, self.host)
        self.conn.create_consumer(node_topic, rpc_dispatcher, fanout=False)

        self.conn.create_consumer(self.topic, rpc_dispatcher, fanout=True)

        # Consume from all consumers in a thread
        self.conn.consume_in_thread()

        if self.periodic_interval:
            periodic = heat_utils.LoopingCall(self.periodic_tasks)
            periodic.start(interval=self.periodic_interval, now=False)
            self.timers.append(periodic)
コード例 #3
0
ファイル: service.py プロジェクト: ishantTyagi/heat
    def start(self):
        vcs_string = version.version_string(type='long')
        LOG.info(_('Starting %(topic)s node (version %(vcs_string)s)'),
                  {'topic': self.topic, 'vcs_string': vcs_string})
        # TODO do we need this ? -> utils.cleanup_file_locks()
        self.manager.init_host()
        self.model_disconnected = False
        ctxt = context.get_admin_context()
        # self._create_service_ref(ctxt)

        self.conn = rpc.create_connection(new=True)
        LOG.debug(_("Creating Consumer connection for Service %s") %
                  self.topic)

        rpc_dispatcher = self.manager.create_rpc_dispatcher()

        # Share this same connection for these Consumers
        self.conn.create_consumer(self.topic, rpc_dispatcher, fanout=False)

        node_topic = '%s.%s' % (self.topic, self.host)
        self.conn.create_consumer(node_topic, rpc_dispatcher, fanout=False)

        self.conn.create_consumer(self.topic, rpc_dispatcher, fanout=True)

        # Consume from all consumers in a thread
        self.conn.consume_in_thread()

        if self.periodic_interval:
            periodic = heat_utils.LoopingCall(self.periodic_tasks)
            periodic.start(interval=self.periodic_interval, now=False)
            self.timers.append(periodic)
コード例 #4
0
ファイル: config.py プロジェクト: devcamcar/heat
 def __init__(self, default_config_files=None, **kwargs):
     super(HeatEngineConfigOpts, self).__init__(
         project='heat',
         version='%%prog %s' % version.version_string(),
         **kwargs)
     config_files = cfg.find_config_files(project='heat',
                                          prog='heat-engine')
     self.register_cli_opts(self.engine_opts)
     self.register_cli_opts(self.db_opts)
     self.register_cli_opts(self.service_opts)
     self.register_cli_opts(rpc_opts)
コード例 #5
0
ファイル: config.py プロジェクト: devcamcar/heat
 def __init__(self, default_config_files=None, **kwargs):
     config_files = cfg.find_config_files(project='heat',
                                          prog='heat-metadata')
     super(HeatMetadataConfigOpts, self).__init__(
         project='heat',
         version='%%prog %s' % version.version_string(),
         default_config_files=default_config_files,
         **kwargs)
     opts = [cfg.IntOpt('bind_port', default=8000),
             cfg.StrOpt('bind_host', default='127.0.0.1')]
     opts.extend(rpc_opts)
     self.register_cli_opts(opts)
コード例 #6
0
ファイル: manager.py プロジェクト: devcamcar/heat
 def service_version(self, context):
     return version.version_string()
コード例 #7
0
 def service_version(self, context):
     return version.version_string()