Skip to content
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

cli: avoid KeyError when PATH isn't set in environment #5590

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

grondo
Copy link
Contributor

@grondo grondo commented Nov 25, 2023

Problem: If PATH is not set in the environment of the flux-run(1) and flux-alloc(1) job submission commands, they raise an unhelpful KeyError and fail to invoke flux job attach, leaving the job running without the interactive attach.

Do not assume PATH is set in these commands when prepending FLUX_EXEC_PATH.

Fixes #5562

Copy link
Member

@garlick garlick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Nov 25, 2023

Codecov Report

Merging #5590 (d2a564f) into master (420e8e7) will decrease coverage by 0.03%.
Report is 15 commits behind head on master.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5590      +/-   ##
==========================================
- Coverage   83.45%   83.43%   -0.03%     
==========================================
  Files         486      486              
  Lines       82450    82456       +6     
==========================================
- Hits        68810    68798      -12     
- Misses      13640    13658      +18     
Files Coverage Δ
src/bindings/python/flux/cli/alloc.py 85.39% <0.00%> (-2.98%) ⬇️
src/bindings/python/flux/cli/run.py 30.00% <0.00%> (-2.44%) ⬇️

... and 9 files with indirect coverage changes

Problem: If PATH is not set in the environment of the flux-run(1)
and flux-alloc(1) job submission commands, they raise an unhelpful
KeyError and fail to invoke `flux job attach`, leaving the job running
without the interactive attach.

Do not assume PATH is set in these commands when prepending
FLUX_EXEC_PATH.

Fixes flux-framework#5562
@mergify mergify bot merged commit f857f63 into flux-framework:master Nov 27, 2023
@grondo grondo deleted the issue#5562 branch December 11, 2024 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyError raised from assumption that os.environ['PATH'] is always non-null
2 participants