From 203c0d4a6c2e23cdc64d1264dcf062f3497f8794 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 10 Jun 2019 14:28:42 -0400 Subject: [PATCH] virt-install: Call install.get_search_paths Similar to what we do via create.py --- virt-install | 2 ++ virtinst/cli.py | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/virt-install b/virt-install index 7db51e31..64105d0b 100755 --- a/virt-install +++ b/virt-install @@ -573,6 +573,8 @@ def build_guest_instance(conn, options): if installer: installer.set_install_defaults(guest) + for path in installer.get_search_paths(guest): + cli.check_path_search(guest.conn, path) # cli specific disk validation for disk in guest.devices.disk: diff --git a/virtinst/cli.py b/virtinst/cli.py index db9219a7..8f78565f 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -298,6 +298,16 @@ def set_prompt(prompt): logging.warning("--prompt mode is no longer supported.") +def check_path_search(conn, path): + searchdata = DeviceDisk.check_path_search(conn, path) + if not searchdata.fixlist: + return + logging.warning(_("%s may not be accessible by the hypervisor. " + "You will need to grant the '%s' user search permissions for " + "the following directories: %s"), + path, searchdata.user, searchdata.fixlist) + + def validate_disk(dev, warn_overwrite=False): def _optional_fail(msg, checkname, warn_on_skip=True): do_check = get_global_state().get_validation_check(checkname) @@ -343,19 +353,10 @@ def validate_disk(dev, warn_overwrite=False): if not isfatal and errmsg: _optional_fail(errmsg, "disk_size", warn_on_skip=False) - def check_path_search(dev): - searchdata = dev.check_path_search(dev.conn, dev.path) - if not searchdata.fixlist: - return - logging.warning(_("%s may not be accessible by the hypervisor. " - "You will need to grant the '%s' user search permissions for " - "the following directories: %s"), - dev.path, searchdata.user, searchdata.fixlist) - check_path_exists(dev) check_inuse_conflict(dev) check_size_conflict(dev) - check_path_search(dev) + check_path_search(dev.conn, dev.path) def _run_console(domain, args):