last_steps.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:munki-enrollment-client 作者: gerritdewitt 项目源码 文件源码
def do_last_steps():
    '''Runs last steps'''
    common.print_info("Starting last steps...")
    # Restore automatic logins if our package postinstall script disabled them:
    if os.path.exists(config_paths.AUTO_LOGIN_PASSWORD_FILE_MOVED):
        try:
            os.rename(config_paths.AUTO_LOGIN_PASSWORD_FILE_MOVED,config_paths.AUTO_LOGIN_PASSWORD_FILE)
        except OSError:
            common.print_error("Could not restore automatic login by moving %s." % config_paths.AUTO_LOGIN_PASSWORD_FILE_MOVED)
    # Remove preference key that disabled FileVault automatic logins.
    # Use defaults since the plist is probably binary.
    osx.defaults_delete('DisableFDEAutoLogin', config_paths.LOGIN_WINDOW_PREFS_FILE)
    # Cleanup files:
    paths_list = config_paths.CLEANUP_FILES_ARRAY
    paths_list.append(config_paths.THIS_LAUNCH_AGENT_PATH)
    common.delete_files_by_path(paths_list)
    if os.path.exists(config_paths.THIS_APP_PATH):
        try:
            shutil.rmtree(config_paths.THIS_APP_PATH)
        except shutil.Error:
            pass
    common.print_info("Completed last steps. Rebooting...")
    # Reboot:
    osx.reboot_system()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号