From bac3ea74ec860e8f7ac3facd2b929cd83e9093f5 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 5 Jun 2018 14:54:34 -0400 Subject: [PATCH] virt-install: Do all option compat conversions earlier Prevents more mistakes like usage of old options when building the Guest instance --- virt-install | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/virt-install b/virt-install index 9975f26b6..6e0ba33b3 100755 --- a/virt-install +++ b/virt-install @@ -562,16 +562,6 @@ def build_guest_instance(conn, options): guest.installer = build_installer(options, conn, guest.os.os_type) - convert_old_memory(options) - convert_old_sound(options) - convert_old_networks(options) - convert_old_graphics(options) - convert_old_disks(options) - convert_old_features(options) - convert_old_cpuset(options) - convert_old_init(options) - convert_old_os_options(options) - # non-xml install options options.extra_args = options.extra_args or [] guest.installer.extraargs = options.extra_args @@ -942,23 +932,29 @@ def main(conn=None): cli.earlyLogging() options = parse_args() - convert_old_printxml(options) - # Default setup options + convert_old_printxml(options) options.quiet = (options.xmlonly or options.test_media_detection or options.quiet) - cli.setupLogging("virt-install", options.debug, options.quiet) - check_cdrom_option_error(options) - - cli.convert_old_force(options) - cli.parse_check(options.check) - cli.set_prompt(options.prompt) - if cli.check_option_introspection(options): return 0 + check_cdrom_option_error(options) + cli.convert_old_force(options) + cli.parse_check(options.check) + cli.set_prompt(options.prompt) + convert_old_memory(options) + convert_old_sound(options) + convert_old_networks(options) + convert_old_graphics(options) + convert_old_disks(options) + convert_old_features(options) + convert_old_cpuset(options) + convert_old_init(options) + convert_old_os_options(options) + if conn is None: conn = cli.getConnection(options.connect)