add in checksum for latest image (RLBT#0000148)
This commit is contained in:
parent
60f97b1c67
commit
65a4ec93c3
@ -1358,6 +1358,7 @@ class IsoBuild:
|
|||||||
|
|
||||||
source_path = latest_artifacts[arch]
|
source_path = latest_artifacts[arch]
|
||||||
drop_name = source_path.split('/')[-1]
|
drop_name = source_path.split('/')[-1]
|
||||||
|
checksum_name = drop_name + '.CHECKSUM'
|
||||||
full_drop = '{}/{}'.format(
|
full_drop = '{}/{}'.format(
|
||||||
image_arch_dir,
|
image_arch_dir,
|
||||||
drop_name
|
drop_name
|
||||||
@ -1407,6 +1408,15 @@ class IsoBuild:
|
|||||||
arch,
|
arch,
|
||||||
formattype
|
formattype
|
||||||
)
|
)
|
||||||
|
latest_path = latest_name.split('/')[-1]
|
||||||
|
latest_checksum = '{}/{}-{}-{}.latest.{}.{}.CHECKSUM'.format(
|
||||||
|
image_arch_dir,
|
||||||
|
self.shortname,
|
||||||
|
self.major_version,
|
||||||
|
imagename,
|
||||||
|
arch,
|
||||||
|
formattype
|
||||||
|
)
|
||||||
# For some reason python doesn't have a "yeah just change this
|
# For some reason python doesn't have a "yeah just change this
|
||||||
# link" part of the function
|
# link" part of the function
|
||||||
if os.path.exists(latest_name):
|
if os.path.exists(latest_name):
|
||||||
@ -1414,6 +1424,17 @@ class IsoBuild:
|
|||||||
|
|
||||||
os.symlink(drop_name, latest_name)
|
os.symlink(drop_name, latest_name)
|
||||||
|
|
||||||
|
self.log.info('Creating checksum for latest symlinked image...')
|
||||||
|
shutil.copy2(checksum_drop, latest_checksum)
|
||||||
|
with open(latest_checksum, 'r') as link:
|
||||||
|
checkdata = link.read()
|
||||||
|
|
||||||
|
checkdata = checkdata.replace(drop_name, latest_path)
|
||||||
|
|
||||||
|
with open(latest_checksum, 'w+') as link:
|
||||||
|
link.write(checkdata)
|
||||||
|
link.close()
|
||||||
|
|
||||||
self.log.info(Color.INFO + 'Image download phase completed')
|
self.log.info(Color.INFO + 'Image download phase completed')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user