本文整理汇总了Python中virtinst.VirtualDisk.check_path_search_for_user方法的典型用法代码示例。如果您正苦于以下问题:Python VirtualDisk.check_path_search_for_user方法的具体用法?Python VirtualDisk.check_path_search_for_user怎么用?Python VirtualDisk.check_path_search_for_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类virtinst.VirtualDisk
的用法示例。
在下文中一共展示了VirtualDisk.check_path_search_for_user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_path_search_for_qemu
# 需要导入模块: from virtinst import VirtualDisk [as 别名]
# 或者: from virtinst.VirtualDisk import check_path_search_for_user [as 别名]
def check_path_search_for_qemu(parent, conn, path):
set_error_parent(parent)
if conn.is_remote() or not conn.is_qemu_system():
return
user = util.running_config.default_qemu_user
skip_paths = util.running_config.get_perms_fix_ignore()
broken_paths = VirtualDisk.check_path_search_for_user(conn.vmm, path, user)
for p in broken_paths:
if p in skip_paths:
broken_paths.remove(p)
if not broken_paths:
return
logging.debug("No search access for dirs: %s", broken_paths)
resp, chkres = err_dial.warn_chkbox(
_("The emulator may not have search permissions "
"for the path '%s'.") % path,
_("Do you want to correct this now?"),
_("Don't ask about these directories again."),
buttons=gtk.BUTTONS_YES_NO)
if chkres:
util.running_config.add_perms_fix_ignore(broken_paths)
if not resp:
return
logging.debug("Attempting to correct permission issues.")
errors = VirtualDisk.fix_path_search_for_user(conn.vmm, path, user)
if not errors:
return
errmsg = _("Errors were encountered changing permissions for the "
"following directories:")
details = ""
for path, error in errors.items():
if path not in broken_paths:
continue
details += "%s : %s\n" % (path, error)
logging.debug("Permission errors:\n%s", details)
ignore, chkres = err_dial.err_chkbox(errmsg, details,
_("Don't ask about these directories again."))
if chkres:
util.running_config.add_perms_fix_ignore(errors.keys())