-
-
Notifications
You must be signed in to change notification settings - Fork 741
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
Update Python runner to throw a more user-friendly exception on missing pack config item #4014
Conversation
pack config dictionary doesn't contain a key user tries to access.
friendly-errors. This way we ensure self.config is always indeed an instance of PackConfigDict class.
key is accessed in self.config dictionary.
st2common/st2common/runners/utils.py
Outdated
|
||
Also make sure you run "st2ctl reload --register-configs" when you add a | ||
config and after every change you make to the config. | ||
" |
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.
that does not look right
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.
Hm, what do you mean? Am I missing something?
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.
Never mind, I see it now - there is an extra double quote here.
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.
Fixed in 4b082b3.
This pull request updates Python runner so it throws a more user-friendly exception when a script tries to access a key in
self.config
dictionary which doesn't exist.@LindsayHill did a good job of adding a note to most pack README.md files which says user need to run
st2ctl reload --register-configs
after adding / modifying configs, but it's still easy to miss / forget that step so we should throw as user-friendly exception as possible.Before:
After:
TODO