Commit 611c1515 authored by Samuel GAIST's avatar Samuel GAIST

[utils] Fix hash generated by storage classes

The hash doesn't match what is done in beat/beat.web> resulting
in a mismatch when using e.g. beat/beat.cmdline>.

This patch modifies the code so that the returned value
follows the same logic as used in beat/beat.web>
parent 6b4b1ec4
Pipeline #34624 passed with stage
in 4 minutes and 49 seconds
......@@ -333,17 +333,13 @@ class CodeStorage(AbstractStorage):
def hash(self):
"""Re-imp"""
declaration_hash = hash.hashJSONFile(self.json.path, "description")
if self.code.exists():
return hash.hash(
dict(
json=hash.hashJSONFile(self.json.path, "description"),
code=hash.hashFileContents(self.code.path),
)
)
code_hash = hash.hashFileContents(self.code.path)
return hash.hash(dict(declaration=declaration_hash, code=code_hash))
else:
return hash.hash(
dict(json=hash.hashJSONFile(self.json.path, "description"))
)
return declaration_hash
def exists(self):
"""Re-imp"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment