virt-install: Reuse cli.fail_conflicting

For the --unattended + --cloud-init conflict

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2022-08-22 10:15:46 -04:00
parent 999ccb85e3
commit 1d64a678d3
2 changed files with 2 additions and 2 deletions

View File

@ -1116,7 +1116,7 @@ c.add_invalid("--disk none --boot network --machine foobar", grep="domain type N
c.add_invalid("--nodisks --boot network --arch mips --virt-type kvm", grep="any virtualization options for architecture 'mips'")
c.add_invalid("--nodisks --boot network --paravirt --arch mips", grep=" 'xen' for architecture 'mips'")
c.add_invalid("--osinfo generic --launchSecurity sev --connect " + utils.URIs.kvm_amd_sev, grep="SEV launch security requires a Q35 UEFI machine")
c.add_invalid("--disk none --cloud-init --unattended --install fedora30", grep="--unattended and --cloud-init can not")
c.add_invalid("--disk none --cloud-init --unattended --install fedora30", grep="Cannot use --unattended and --cloud-init at the same time")

View File

@ -412,7 +412,7 @@ def build_installer(options, guest, installdata):
extra_args = [installdata.kernel_args]
if options.unattended and options.cloud_init:
fail("--unattended and --cloud-init can not be specified together.")
cli.fail_conflicting("--unattended", "--cloud-init")
if options.unattended:
unattended_data = cli.parse_unattended(options.unattended)