'Get the known agent resource versions and update the tracker.
This function looks up into the database and updates every agent
resource versions.
This method is called from version_manager when the cached information
has passed TTL.
:param tracker: receives a version_manager.ResourceConsumerTracker'

def get_agents_resource_versions(self, tracker):

    for agent in self._get_agents_considered_for_versions():
        resource_versions = agent.get('resource_versions', {})
        consumer = version_manager.AgentConsumer(agent_type=agent['agent_type'], host=agent['host'])
        LOG.debug('Update    consumer    %(consumer)s    versions    to:    %(versions)s', {'consumer': consumer, 'versions': resource_versions})
        tracker.set_versions(consumer, resource_versions)
