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>
|
<os>
|
||||||
<loader dev='hd'/>
|
<loader dev='hd'/>
|
||||||
</os>
|
</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)}'/>
|
<drive disk='${disk.name}' target='hd${chr(letter)}'/>
|
||||||
%endfor
|
%endfor
|
||||||
</boot>
|
</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)
|
log.info("Calculating SHA256 checksum of %s", disk_img)
|
||||||
sha256 = hashlib.sha256()
|
sha256 = hashlib.sha256()
|
||||||
with open(disk_img) as f:
|
with open(disk_img, "rb") as f:
|
||||||
while True:
|
while True:
|
||||||
data = f.read(1024**2)
|
data = f.read(1024**2)
|
||||||
if not data:
|
if not data:
|
||||||
|
Loading…
Reference in New Issue
Block a user