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