def METHOD_NAME(debugfs_path, session):
    """
    Umount the debugfs and close the session
    """
    if os.path.ismount(debugfs_path):
        process.run("umount %s" % debugfs_path, shell=True)
    if os.path.isdir(debugfs_path):
        os.removedirs(debugfs_path)
    session.close()