Ejemplo n.º 1
0
    def _update_consumer_versions(self):
        new_tracker = ResourceConsumerTracker()
        neutron_plugin = directory.get_plugin()
        agents_db = _import_agents_db()
        # If you use RPC callbacks, your plugin needs to implement
        # AgentsDbMixin so that we know which resource versions your
        # agents consume via RPC, please note that rpc_callbacks are
        # only designed to work with agents currently.
        if isinstance(neutron_plugin, agents_db.AgentDbMixin):
            neutron_plugin.get_agents_resource_versions(new_tracker)
        else:
            raise exceptions.NoAgentDbMixinImplemented()

        self._versions = new_tracker
        self._versions.report()
Ejemplo n.º 2
0
    def _update_consumer_versions(self):
        LOG.info('%s(): caller(): %s', log_utils.get_fname(1),
                 log_utils.get_fname(2))
        new_tracker = ResourceConsumerTracker()
        neutron_plugin = directory.get_plugin()
        agents_db = _import_agents_db()
        # If you use RPC callbacks, your plugin needs to implement
        # AgentsDbMixin so that we know which resource versions your
        # agents consume via RPC, please note that rpc_callbacks are
        # only designed to work with agents currently.
        if isinstance(neutron_plugin, agents_db.AgentDbMixin):
            neutron_plugin.get_agents_resource_versions(new_tracker)
        else:
            raise exceptions.NoAgentDbMixinImplemented()

        # preserve last report state so we don't duplicate logs on refresh
        new_tracker.last_report = self._versions.last_report
        self._versions = new_tracker
        self._versions.report()