hotfix for ipxe checksum chicanery

This commit is contained in:
brent s. 2021-01-23 01:39:23 -05:00
parent 87b6ed1e80
commit bbe9e2497b
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -83,7 +83,8 @@ class Updater(_base.BaseUpdater):
self.old_hash = ver_info.get(self.hash_type)
self.old_ver = datetime.datetime.strptime(ver_info['ver'], self._datever_fmt)
self.variant = ver_info.get('variant', self.variant)
self.new_hash = self.old_hash
# We do this to avoid the hash check in _base.BaseUpdater.download()
self._new_hash = self.old_hash
self.new_date = self.old_date
self.new_ver = self.old_ver
if ver_info.get('arch') != self.arch:
@ -161,11 +162,11 @@ class Updater(_base.BaseUpdater):
if self.getRunning():
return(None)
if any((self.do_update, self.force_update)):
self.new_hash = self.getISOHash()
self._new_hash = self.getISOHash()
d = {'date': self.new_date.strftime(self._date_fmt),
'variant': self.variant,
'ver': self.new_ver.strftime(self._datever_fmt),
self.hash_type: self.new_hash}
self.hash_type: self._new_hash}
j = json.dumps(d, indent = 4)
with open(self.dest_ver, 'w') as fh:
fh.write(j)