Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repository_tool and repository_lib modify log handlers #1148

Closed
jku opened this issue Sep 22, 2020 · 1 comment
Closed

repository_tool and repository_lib modify log handlers #1148

jku opened this issue Sep 22, 2020 · 1 comment

Comments

@jku
Copy link
Member

jku commented Sep 22, 2020

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.

@jku
Copy link
Member Author

jku commented Feb 16, 2022

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.

@jku jku closed this as completed Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant