centralize getting the hash because duh
This commit is contained in:
14
arch.py
14
arch.py
@@ -13,7 +13,6 @@
|
||||
|
||||
import datetime
|
||||
import json
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
##
|
||||
@@ -133,17 +132,14 @@ class Updater(_base.BaseUpdater):
|
||||
# if ver_info.get('arch') != self.arch:
|
||||
# self.do_update = True
|
||||
# self.force_update = True
|
||||
try:
|
||||
hasher = hashlib.new(self.hash_type)
|
||||
with open(self.dest_iso, 'rb') as fh:
|
||||
hasher.update(fh.read())
|
||||
if self.old_hash != hasher.hexdigest().lower():
|
||||
self.do_update = True
|
||||
self.force_update = True
|
||||
except FileNotFoundError:
|
||||
if not os.path.isfile(self.dest_iso):
|
||||
self.do_update = True
|
||||
self.force_update = True
|
||||
return(None)
|
||||
realhash = self.getISOHash()
|
||||
if self.old_hash != realhash:
|
||||
self.do_update = True
|
||||
self.force_update = True
|
||||
return(None)
|
||||
|
||||
def getNet(self):
|
||||
|
||||
Reference in New Issue
Block a user