stages/org.osbuild.ovf: support older python3 versions

The `capture_output` option was added in python3.7, yet el8 has
python3.6 by default.
This commit is contained in:
Sanne Raymaekers 2023-04-04 10:31:36 +02:00 committed by Tomáš Hozza
parent 76a80bd8c5
commit efa038197d

View file

@ -117,7 +117,7 @@ OVF_TEMPLATE = """<?xml version="1.0"?>
def virtual_size(vmdk):
cmd = ["qemu-img", "info", "--output=json", vmdk]
res = subprocess.run(cmd, check=True, capture_output=True)
res = subprocess.run(cmd, check=True, stdout=subprocess.PIPE, encoding="utf8")
if res.returncode != 0:
raise RuntimeError("Unable to determine vmdk size")
return json.loads(res.stdout)["virtual-size"]