Skip to content

Commit

Permalink
more hashlib usage
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo committed Dec 6, 2024
1 parent ddd0861 commit d82410a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scale_build/image/iso.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import glob
import hashlib
import itertools
import os
import shutil
Expand Down Expand Up @@ -201,9 +202,8 @@ def make_iso_file():

image_version = get_image_version(vendor=TRUENAS_VENDOR)
with open(os.path.join(RELEASE_DIR, f'TrueNAS-SCALE-{image_version}.iso.sha256'), 'w') as f:
f.write(run(
['sha256sum', os.path.join(RELEASE_DIR, f'TrueNAS-SCALE-{image_version}.iso')], log=False
).stdout.replace(f'{RELEASE_DIR}/', '').strip())
with open(os.path.join(RELEASE_DIR, f'TrueNAS-SCALE-{image_version}.iso'), 'rb') as sf:
f.write(hashlib.file_digest(sf, 'sha256').hexdigest())


def pruning_cd_basedir_contents():
Expand Down

0 comments on commit d82410a

Please sign in to comment.