-
Notifications
You must be signed in to change notification settings - Fork 0
Configure kadi logger globally + other refactoring #400
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
Conversation
What was the hidden dependence? Or, equivalently, how does this fix it? |
The call to kadi |
And the fix is to set the environment variable early in the perl script before anything else happens. |
Makes sense. Thanks! |
@jeanconn - just a reminder here that you should take over the functional testing of this, which I can then review. |
starcheck/utils.py
Outdated
logger = logging.getLogger(name) | ||
logger.setLevel(loglevel) | ||
|
||
# Remove existing handlers if calc_ccd_temps is called multiple times |
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.
This is no longer in calc_ccd_temps so I assume this comment should go. Not 100% if the code is right for it as well but...
starcheck/utils.py
Outdated
logger.addHandler(console) | ||
|
||
filehandler = logging.FileHandler( | ||
filename=os.path.join(outdir, 'run.dat'), mode='w') |
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.
And now this happens before outdir is made, so should perhaps make outdir here as needed.
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 updated to just make the output directory here for now.
@taldcroft I don't think I can request a review on it from you, but is that what you had in mind for functional testing or would you like some other variations? |
@taldcroft figured I'd check once more about this now that you are back. |
@jeanconn - I have reviewed your functional testing and it looks fine. I pushed another commit so I'll re-request a final review from you. I'll update the functional test description momentarily. |
Description
Fixes the issue noted on slack (#missionplanning "SOT MP run of starcheck did not generate the expected output files for the OCT1722B products"), that get_dither_kadi_state would run before
KADI_SCENARIO=flight
was set, causing HEAD starcheck to still have a network dependence for SOT MP's run of the tool.In the course of implementing the fix, some refactoring and rework of existing code was useful.
Interface impacts
Testing
Unit tests
Functional tests
Disabled occweb access and confirmed that master fails to use 'flight' scenario:
Confirmed that this PR (with the same disabled .netrc etc) works and that KADI_SCENARIO is set to flight before/for all kadi command queries.
Testing of 403a1d6
By default the output does not include any kadi logging output. Confirmed this with:
Also ran with
-verbose=0
and got the same results. Then ran with-verbose=2
and got kadiDEBUG
output:Previous behavior reported by @jeanconn, NO LONGER accurate
The new STDERR output has "Getting commands from archive only" whenever a call was made to kadi commands. Seems fine. The first call also shows when the commands were loaded (happens once)
This is fine as well.