def check_cluster_versions(cluster, required, recommended=Version((3, 0, 4)), label=None): try: with cluster.all() as client: results = client.info() except Exception as e: # Any connection issues should be caught here. raise InvalidConfiguration(unicode(e)) versions = {} for id, info in results.value.items(): host = cluster.hosts[id] # NOTE: This assumes there is no routing magic going on here, and # all requests to this host are being served by the same database. key = '{host}:{port}'.format(host=host.host, port=host.port) versions[key] = Version(map(int, info['redis_version'].split('.', 3))) check_versions( 'Redis' if label is None else 'Redis (%s)' % (label, ), versions, required, recommended, )
def validate(self): logger.debug('Validating Redis version...') version = Version((2, 8, 18)) if self.enable_frequency_sketches else Version((2, 8, 9)) check_cluster_versions( self.cluster, version, recommended=Version((2, 8, 18)), label='TSDB', )
def validate(self): logger.debug('Validating Redis version...') check_cluster_versions( self.cluster, Version((2, 8, 9)), label='Digests', )
def validate(self): logger.info('Validating Redis version...') check_cluster_versions( self.cluster, Version((2, 8, 9)), label='TSDB', )
def validate(self): logger.info('Validating Redis version...') try: with self.cluster.all() as client: results = client.info() except Exception as e: # Any connection issues should be caught here. raise InvalidConfiguration(unicode(e)) versions = {} for id, info in results.value.items(): host = self.cluster.hosts[id] # NOTE: This assumes there is no routing magic going on here, and # all requests to this host are being served by the same database. key = '{host}:{port}'.format(host=host.host, port=host.port) versions[key] = Version( map(int, info['redis_version'].split('.', 3))) check_versions('Redis (TSDB)', versions, Version((2, 8, 9)), Version((3, 0, 4)))
def check_cluster_versions(cluster, required, recommended=None, label=None): try: with cluster.all() as client: results = client.info() except Exception as e: # Any connection issues should be caught here. raise InvalidConfiguration(str(e)) versions = {} for id, info in results.value.items(): host = cluster.hosts[id] # NOTE: This assumes there is no routing magic going on here, and # all requests to this host are being served by the same database. key = f"{host.host}:{host.port}" versions[key] = Version(map(int, info["redis_version"].split(".", 3))) check_versions("Redis" if label is None else f"Redis ({label})", versions, required, recommended)
def validate(self) -> None: logger.debug("Validating Redis version...") check_cluster_versions(self.cluster, Version((2, 8, 9)), label="Digests")