Cray-HPE / sat

System Admin Toolkit
https://cray-hpe.github.io/docs-sat/
MIT License
4 stars 5 forks source link

CRAYSAT-1890: Fix `sat.waiting` logger #247

Closed haasken-hpe closed 2 months ago

haasken-hpe commented 2 months ago

Summary and Scope

The LOGGER was incorrectly created with __file__ as the logger name instead of __name__. As a result, it was not included under the sat package logger's hierarchy, and the expected log handlers were not applied to messages logged by this module. Fix this by specifying __name__ instead, so the logger has the name sat.waiting, which is under the sat logger.

Issues and Related PRs

Testing

Tested on:

Test description:

Ran sat bootsys shutdown --stage capture-state followed by sat bootsys boot --stage k8s-check --k8s-timeout 10 to force a Waiter subclass to timeout, so I could observe the error log message. As expected, it timed out waiting on new pods that were created by K8s Jobs to reach a running or completed state, and it emitted the correctly formatted log message of the form:

ERROR: Waiting for condition "..." timed out after 10 seconds

Risks and Mitigations

Very low risk logging fix.

Pull Request Checklist

haasken-hpe commented 2 months ago

Thank you both! I'll wait to merge this until after @annapoorna-s-alt has merged the feature/CRAYSAT-1740 branch to main, just so you don't have to deal with more changelog conflicts.

haasken-hpe commented 2 months ago

I just rebased this on the latest main branch after merging @annapoorna-s-alt 's PR to merge the feature/CRAYSAT-1740 branch to main. As a result, I changed the version in the changelog to 3.29.1.