-
Notifications
You must be signed in to change notification settings - Fork 24k
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
[WIP] Decouple display from config initialization #43519
base: devel
Are you sure you want to change the base?
[WIP] Decouple display from config initialization #43519
Conversation
The test
|
This is an attempt to give ansible the ability to print out errors with the config code. It does succeed in decoupling display from config. Unfortunately, the structure of config and cli currently means that you have to load a bunch of other pieces of code which need config before you get to process the code which could print out the config errors. Since those fail without config, those cause the whole thing to break down. It could be worthwhile to continue in this vein, reorganizing the code so that we can do all of our static loading (option parsing and config loading) up front before moving on to the rest of the code which needs to utilize config but before that happens I hope to move display() to using a logging framework. If that happens, we won't need this anyway.
bc8ef4e
to
cc8e72b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment that's no longer relevant (I think?), otherwise LGTM
""" Display a message to the user | ||
|
||
Note: msg *must* be a unicode string to prevent UnicodeError tracebacks. | ||
Note: color is deprecated. Use type instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer relevant?
This is an attempt to give ansible the ability to print out errors with
the config code. It does succeed in decoupling display from config.
Unfortunately, the structure of config and cli currently means that you
have to load a bunch of other pieces of code which need config before
you get to process the code which could print out the config errors.
Since those fail without config, those cause the whole thing to break
down.
It could be worthwhile to continue in this vein, reorganizing the code
so that we can do all of our static loading (option parsing and config
loading) up front before moving on to the rest of the code which needs
to utilize config but before that happens I hope to move display() to
using a logging framework. If that happens, we won't need this anyway.
ISSUE TYPE
COMPONENT NAME
utils/display.py
ANSIBLE VERSION
ADDITIONAL INFORMATION