fix: sha256 instead of sha1 for metric_id
fix: allowlist added to tox Change-Id: I7d99515c07f2b01394d869d437327ab27ffa4a44
This commit is contained in:
parent
1ea4e21eb2
commit
46f0cc38ee
@ -132,7 +132,7 @@ class MetricCassandraRepository(abstract_repository.AbstractCassandraRepository)
|
||||
dim_names.append(name)
|
||||
|
||||
hash_string = '%s\0%s\0%s\0%s' % (region, tenant_id, metric_name, '\0'.join(dim_list))
|
||||
metric_id = hashlib.sha1(hash_string.encode('utf8')).hexdigest()
|
||||
metric_id = hashlib.sha256(hash_string.encode('utf8')).hexdigest()
|
||||
|
||||
# TODO(brtknr): If database per tenant becomes the default and the
|
||||
# only option, recording tenant_id will be redundant.
|
||||
|
@ -128,7 +128,7 @@ def main():
|
||||
hash_string = '%s\0%s\0%s\0%s' % (row.region, row.tenant_id,
|
||||
row.metric_name,
|
||||
'\0'.join(row.dimensions))
|
||||
# metric_id = hashlib.sha1(hash_string.encode('utf8')).hexdigest()
|
||||
# metric_id = hashlib.sha256(hash_string.encode('utf8')).hexdigest()
|
||||
# id_bytes = bytearray.fromhex(metric_id)
|
||||
|
||||
LOG.info("Recreated hash for metric id: {}".format(hash_string))
|
||||
|
@ -143,7 +143,7 @@ def main():
|
||||
hash_string = '%s\0%s\0%s\0%s' % (row.region, row.tenant_id,
|
||||
row.metric_name,
|
||||
'\0'.join(row.dimensions))
|
||||
metric_id = hashlib.sha1(hash_string.encode('utf8')).hexdigest()
|
||||
metric_id = hashlib.sha256(hash_string.encode('utf8')).hexdigest()
|
||||
id_bytes = bytearray.fromhex(metric_id)
|
||||
|
||||
LOG.info("Recreated hash for metric id: {}".format(hash_string))
|
||||
|
Loading…
Reference in New Issue
Block a user