当前位置: 首页>>代码示例>>Python>>正文


Python VirtualDisk.fix_path_search_for_user方法代码示例

本文整理汇总了Python中virtinst.VirtualDisk.fix_path_search_for_user方法的典型用法代码示例。如果您正苦于以下问题:Python VirtualDisk.fix_path_search_for_user方法的具体用法?Python VirtualDisk.fix_path_search_for_user怎么用?Python VirtualDisk.fix_path_search_for_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在virtinst.VirtualDisk的用法示例。


在下文中一共展示了VirtualDisk.fix_path_search_for_user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_path_search_for_qemu

# 需要导入模块: from virtinst import VirtualDisk [as 别名]
# 或者: from virtinst.VirtualDisk import fix_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())
开发者ID:sandeep-krishnamurthy,项目名称:vm_affinity_management_tool_for_kvm,代码行数:52,代码来源:uihelpers.py


注:本文中的virtinst.VirtualDisk.fix_path_search_for_user方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。