-
Notifications
You must be signed in to change notification settings - Fork 259
utils_sys: check bootc available #4272
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Dan Zheng <dzheng@redhat.com>
WalkthroughThe Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Package mode:
Bootc installed:
Image mode:
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
virttest/utils_sys.py (1)
100-102: LGTM! Early guard correctly handles missing bootc command.The implementation properly short-circuits when
bootcis unavailable, avoiding unnecessary command execution and error messages. The logic aligns with the expected behavior described in the PR comments.Optional: Consider adding debug logging for better observability.
Adding a log message when
bootcis not found would improve debuggability and make the behavior more transparent:status, _ = cmd_status_output("which bootc", shell=True, session=session) if status: + LOG.debug("bootc command not found, assuming package mode") return False
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
virttest/utils_sys.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
virttest/utils_sys.py (2)
virttest/remote_commander/remote_runner.py (1)
shell(660-676)virttest/utils_netperf.py (1)
session(122-124)
🪛 Ruff (0.14.5)
virttest/utils_sys.py
100-100: Function call with shell=True parameter identified, security issue
(S604)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: avocado_devel AVOCADO_SRC:git+https://github.com/avocado-framework/avocado@103lts#egg=avocado_framework SETUP:-m pip install . VT_TYPE:qemu
- GitHub Check: avocado_devel AVOCADO_SRC:git+https://github.com/avocado-framework/avocado#egg=avocado_framework SETUP:-m pip install PYPI_UPLOAD/*.whl VT_TYPE:qemu
smitterl
left a comment
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.
lgtm thank you
| ) | ||
| return result | ||
|
|
||
| status, _ = cmd_status_output("which bootc", shell=True, session=session) |
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.
avocado.utils.path provides find_command
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 know. Considering aautils repo, I guest avocado.utils.path will be moved. So now I am not sure if I should use it. What's your idea? @PaulYuuu
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 am okay for both, the current implementation is simple and applicable to hosts/guest.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.