-
Notifications
You must be signed in to change notification settings - Fork 18
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
FIX: more error handling for ElogPoster #389
Conversation
Seems like elog was never an explicit dependency on the pip-side, weird (not weird, it's not on pypi) I forget, why haven't we added it to pypi? |
It must be some issue with a dependency of a dependency that we couldn't get onto pypi |
For this PR, I'll just protect the import in the safe load or in a try/except |
The actual answer is probably that |
ah yes. PyPi's elog is an unmaintained elasticsearch log system https://pypi.org/project/elog/ Proposals for names? Of course we already have an issue for this. pcdshub/elog#30 |
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.
Seems like a good fix.
raise RuntimeError("RE not loaded, skip ElogPoster") | ||
# Even if they exist, things can go wrong if the user accidentally clobbers the name | ||
if not isinstance(elog, HutchELog): | ||
raise RuntimeError("elog replaced, skip ELogPoster") |
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.
I guess this is something the hint banner could also fall prey to, if someone overwrites an existing namespace global.
I think it's maybe a small miracle that we haven't hit upon a case where a hutch overwrites one of our helpful namespaces (a
, m
, etc). Or maybe they just don't use those and access the motors by name explicitly. 🤷
Description
This comes from a hotfix in rix3 that I added onto here.
There is a niche issue where "something" gets loaded as the
elog
but it isn't a valid elog object. Then, this script picks up the non-elog item and passes it to theElogPoster
, which starts causing an issue (text spam? I don't quite remember) when you try to run a scan later.This PR rearranges the error reporting a bit and includes a check that the expected objects haven't been replaced.
Motivation and Context
elog
object, instead just fail theElogPoster
in red textHow Has This Been Tested?
Interactively only, checking the error messages
Where Has This Been Documented?
Here only
Pre-merge checklist
docs/pre-release-notes.sh
and created a pre-release documentation page