Skip to content

fix: Incorrect credentials are masked by traceback#518

Merged
grafuls merged 1 commit intoredhat-performance:developmentfrom
sadsfae:development
Feb 13, 2026
Merged

fix: Incorrect credentials are masked by traceback#518
grafuls merged 1 commit intoredhat-performance:developmentfrom
sadsfae:development

Conversation

@sadsfae
Copy link
Member

@sadsfae sadsfae commented Feb 13, 2026

  • find_session_uri masks a proper error message when someone passes incorrect credentials (either by vars or user/pass).
  • response body seems to be a JSON object and not a redfish root object and we are not generating a useful error, instead the user gets a traceback that masks the real cause.

before (see #517)

after

-=>>PYTHONPATH="./src" python3 src/badfish/main.py -H mgmt-d23-h31-000-r650.example.com -u root -p awrongpassword --power-state
- WARNING  - Passing secrets via command line arguments can be unsafe. Consider using environment variables (BADFISH_USERNAME, BADFISH_PASSWORD).
- ERROR    - Failed to authenticate. Verify your credentials for mgmt-d23-h31-000-r650.example.com
  • Also remove asyncio import from tests/test_main_coverage.py as it wasn't being utilized.

fixes: #517

* find_session_uri masks a proper error message when someone passes
  incorrect credentials (either by vars or user/pass).
* response body seems to be a JSON object and not a redfish root object
  and we are not generating a useful error, instead the user gets a
traceback that masks the real cause.

before (see redhat-performance#517)

after

-=>>PYTHONPATH="./src" python3 src/badfish/main.py -H mgmt-d23-h31-000-r650.example.com -u root -p awrongpassword --power-state
- WARNING  - Passing secrets via command line arguments can be unsafe. Consider using environment variables (BADFISH_USERNAME, BADFISH_PASSWORD).
- ERROR    - Failed to authenticate. Verify your credentials for mgmt-d23-h31-000-r650.example.com

* Also remove asyncio import from tests/test_main_coverage.py as it
  wasn't being utilized.

fixes: redhat-performance#517
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.09%. Comparing base (3de528b) to head (54fa694).
⚠️ Report is 3 commits behind head on development.

Additional details and impacted files
@@               Coverage Diff               @@
##           development     #518      +/-   ##
===============================================
+ Coverage        92.07%   92.09%   +0.01%     
===============================================
  Files                8        8              
  Lines             2511     2516       +5     
===============================================
+ Hits              2312     2317       +5     
  Misses             199      199              
Flag Coverage Δ
unittests 92.09% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@grafuls grafuls merged commit 69bf855 into redhat-performance:development Feb 13, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants