Skip to content

Commit

Permalink
Check for current state
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Nov 24, 2024
1 parent 8086f5d commit 22e4f25
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/suse-distro-blockchain/suse-distro-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ def main(argv: List[str] = None) -> None:
)
parser.add_argument(
"aliases",
metavar="zyppc alias",
nargs="+",
help="The alias of a repository defined in zypp repo file",
help="The alias of a repository to be checked as defined in zypp repo file",
)
args = parser.parse_args(argv)

Expand Down Expand Up @@ -137,6 +136,14 @@ def main(argv: List[str] = None) -> None:
print(f"Critical Security Issues: {product[2]}")
print(f"Same Rebuild Attestated: {build[2]}")

print()
current_verification = contract.functions.current_product_build(product[0], build[1]).call()
if verification == current_verification:
print("The contract proofed your repository cache as current state :)")
else:
print(f"ERROR: The contract has different current state registered: {current_verification}")
exit(1)

if __name__ == "__main__": # pragma: nocover
main()

Expand Down

0 comments on commit 22e4f25

Please sign in to comment.