parameters: ()
docstring: Take the current OverlayFS merged view and finalize a copy outside of
    OverlayFS, ready to be swapped-in at BASEDIR. Copy using shutil.copytree
docstring_summary: Take the current OverlayFS merged view and finalize a copy outside of
    OverlayFS, ready to be swapped-in at BASEDIR. Copy using shutil.copytree
docstring_tokens: Take the current OverlayFS merged view and finalize a copy outside of OverlayFS ready to be swapped - in at BASEDIR . Copy using shutil . copytree
function: def finalize_update() -> None:
    """Take the current OverlayFS merged view and finalize a copy outside of
    OverlayFS, ready to be swapped-in at BASEDIR. Copy using shutil.copytree"""
  
    # Remove the update ready flag and any old updates
    cloudlog.info("creating finalized version of the overlay")
    set_consistent_flag(False)
  
    # Copy the merged overlay view and set the update ready flag
    if os.path.exists(FINALIZED):
      shutil.rmtree(FINALIZED)
    shutil.copytree(OVERLAY_MERGED, FINALIZED, symlinks=True)
  
    run(["git", "reset", "--hard"], FINALIZED)
    run(["git", "submodule", "foreach", "--recursive", "git", "reset"], FINALIZED)
  
    set_consistent_flag(True)
    cloudlog.info("done finalizing overlay")
function_tokens: def finalize_update ( ) -> None : # Remove the update ready flag and any old updates cloudlog . info ( "creating finalized version of the overlay" ) set_consistent_flag ( False ) # Copy the merged overlay view and set the update ready flag if os . path . exists ( FINALIZED ) : shutil . rmtree ( FINALIZED ) shutil . copytree ( OVERLAY_MERGED , FINALIZED , symlinks = True ) run ( [ "git" , "reset" , "--hard" ] , FINALIZED ) run ( [ "git" , "submodule" , "foreach" , "--recursive" , "git" , "reset" ] , FINALIZED ) set_consistent_flag ( True ) cloudlog . info ( "done finalizing overlay" )