virt-install: Call install.get_search_paths
Similar to what we do via create.py
This commit is contained in:
parent
b7465fdcf8
commit
203c0d4a6c
|
@ -573,6 +573,8 @@ def build_guest_instance(conn, options):
|
||||||
|
|
||||||
if installer:
|
if installer:
|
||||||
installer.set_install_defaults(guest)
|
installer.set_install_defaults(guest)
|
||||||
|
for path in installer.get_search_paths(guest):
|
||||||
|
cli.check_path_search(guest.conn, path)
|
||||||
|
|
||||||
# cli specific disk validation
|
# cli specific disk validation
|
||||||
for disk in guest.devices.disk:
|
for disk in guest.devices.disk:
|
||||||
|
|
|
@ -298,6 +298,16 @@ def set_prompt(prompt):
|
||||||
logging.warning("--prompt mode is no longer supported.")
|
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 validate_disk(dev, warn_overwrite=False):
|
||||||
def _optional_fail(msg, checkname, warn_on_skip=True):
|
def _optional_fail(msg, checkname, warn_on_skip=True):
|
||||||
do_check = get_global_state().get_validation_check(checkname)
|
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:
|
if not isfatal and errmsg:
|
||||||
_optional_fail(errmsg, "disk_size", warn_on_skip=False)
|
_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_path_exists(dev)
|
||||||
check_inuse_conflict(dev)
|
check_inuse_conflict(dev)
|
||||||
check_size_conflict(dev)
|
check_size_conflict(dev)
|
||||||
check_path_search(dev)
|
check_path_search(dev.conn, dev.path)
|
||||||
|
|
||||||
|
|
||||||
def _run_console(domain, args):
|
def _run_console(domain, args):
|
||||||
|
|
Loading…
Reference in New Issue