'Set or update a consumer resource type version.'

def _set_version(self, consumer, resource_type, version):

    self._versions[resource_type].add(version)
    consumer_versions = self._versions_by_consumer[consumer]
    prev_version = consumer_versions.get(resource_type, None)
    if version:
        consumer_versions[resource_type] = version
    else:
        consumer_versions.pop(resource_type, None)
    if (prev_version != version):
        self._needs_recalculation = True
        LOG.debug('Version    for    resource    type    %(resource_type)s    changed    %(prev_version)s    to    %(version)s    on    consumer    %(consumer)s', {'resource_type': resource_type, 'version': version, 'prev_version': prev_version, 'consumer': consumer})
