Skip to content

repository_tool and repository_lib modify log handlers #1148

Closed

Description

@jku

Just importing repository_tool affects all of tuf logging (because it runs add_console_handler() and set_console_log_level()).

Probably because of this many tests and repo.py call some version of disable_console_log_messages().

This feels fragile and easy to accidentally misuse. I think the idea is that repository_tool.py is intended for "devops" use in an interactive python session... but then the same script is used in e.g. tests very much like a normal library.

If the interactive helper functionality is seen as important, I wonder if we should separate the use cases: keep the "library functionality" (that would not modify logging or even provide functions for doing that) and then provide a separate tool for interactive use, maybe something like this

repo_tool:

#!/bin/sh
python3 -i repo_tool_helper.py

repo_tool_helper.py

import tuf.repository_tool as repo_tool
import tuf.log

# setup tuf logging here as appropriate for this tool

now running repo_tool would give you an interactive python session with modules imported and logging setup appropriately.

Activity

  1. jku commented on Feb 16, 2022

    @jku
    MemberAuthor

    Closing this issue as it was filed against (what is now known as) the legacy codebase: issue seems to not be relevant anymore. Please re-open or file a new issue if you feel that the issue is revelant to current python-tuf.

    More details

    Current source code (and upcoming 1.0 release) only contains the modern components

    • a low-level Metadata API (tuf.api) and
    • tuf.ngclient that implements the client workflow,

    Legacy components (e.g. tuf.client, tuf.repository_tool, tuf.repository_lib as well as the repo and client scripts) are no longer included. See announcement and API reference for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions