fingerprinted now should work correctly

This commit is contained in:
Si11ium
2020-05-19 08:33:04 +02:00
parent e423d6fe31
commit 206aca10b3
7 changed files with 16 additions and 7 deletions

View File

@ -39,10 +39,15 @@ class Config(ConfigParser, ABC):
h = hashlib.md5()
params = deepcopy(self.as_dict)
del params['model']['type']
del params['model']['secondary_type']
del params['data']['worker']
del params['main']
h.update(str(params).encode())
del params['project']
# Flatten the dict of dicts
for section in list(params.keys()):
params.update({f'{section}_{key}': val for key, val in params[section].items()})
del params[section]
_, vals = zip(*sorted(params.items(), key=lambda tup: tup[0]))
h.update(str(vals).encode())
fingerprint = h.hexdigest()
return fingerprint