def start_install(*args, **kwargs): virtinstall.create_image_file(*args, **kwargs) cmd = virtinstall.build_commandline("qemu:///system", *args, **kwargs) rc, result, result_stderr = utils.subprocess_get_response(cmd, ignore_rc=True, get_stderr=True) if rc != 0: raise utils.InfoException("command failed (%s): %s %s" % (rc, result, result_stderr))
02110-1301 USA """ import os import re import shlex import app as koan import utils # The virtinst module will no longer be availabe to import in some # distros. We need to get all the info we need from the virt-install # command line tool. This should work on both old and new variants, # as the virt-install command line tool has always been provided by # python-virtinst (and now the new virt-install rpm). rc, response = utils.subprocess_get_response( shlex.split('virt-install --version'), True) if rc == 0: virtinst_version = response else: virtinst_version = None # This one's trickier. We need a list of supported os varients, but # the man page explicitly says not to parse the result of this command. # But we need it, and there's no other way to get it. I spoke with the # virt-install maintainers and they said the point of that message # is that you can't absolutely depend on the output not changing, but # at the moment it's the only option for us. Long term plans are for # virt-install to switch to libosinfo for OS metadata tracking, which # provides a library and tools for querying valid OS values. Until # that's available and pervasive the best we can do is to use the # module if it's availabe and if not parse the command output.