Fix make_appliance and the libvirt.tmpl
Apparently nobody has used these since the switch to py3, xrange is now range and it needs to read the file in binary mode when generating the sha256.
This commit is contained in:
parent
134a333d92
commit
8e749efbbf
@ -9,7 +9,7 @@
|
||||
<os>
|
||||
<loader dev='hd'/>
|
||||
</os>
|
||||
%for disk, letter in zip(disks, xrange(97, 123)):
|
||||
%for disk, letter in zip(disks, range(97, 123)):
|
||||
<drive disk='${disk.name}' target='hd${chr(letter)}'/>
|
||||
%endfor
|
||||
</boot>
|
||||
|
@ -155,7 +155,7 @@ def make_appliance(disk_img, name, template, outfile, networks=None, ram=1024,
|
||||
|
||||
log.info("Calculating SHA256 checksum of %s", disk_img)
|
||||
sha256 = hashlib.sha256()
|
||||
with open(disk_img) as f:
|
||||
with open(disk_img, "rb") as f:
|
||||
while True:
|
||||
data = f.read(1024**2)
|
||||
if not data:
|
||||
|
Loading…
Reference in New Issue
Block a user