Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1867 | printing fields used for checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Jul 9, 2024
1 parent 6a36415 commit 8637d39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/common/checksums.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def generate_checksum(data):

@staticmethod
def generate_checksum_from_many(data):
print("****before cleanup fields***")
from pprint import pprint as p
p(data)
checksums = [
Checksum.generate(ChecksumModel._cleanup(_data)) for _data in data
] if isinstance(data, list) else [
Expand Down
4 changes: 3 additions & 1 deletion generate_checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ def generate(resource, data, checksum_type='standard'):
elif resource == 'mapping':
data = [get_mapping_fields(_data, checksum_type) for _data in flatten([data])]
from pprint import pprint as p
print("\n")
print("Fields for Checksum:")
p(data)
checksums = [
_generate(_cleanup(_data)) for _data in data
Expand Down Expand Up @@ -188,7 +190,7 @@ def main():
try:
result = generate(args.resource, json.loads(args.data), args.checksum_type)
print("\n")
print(f'{args.checksum_type} checksum: {result}')
print(f'{args.checksum_type.title()} Checksum: {result}')
except Exception as e:
print(e)
print()
Expand Down

0 comments on commit 8637d39

Please sign in to comment.