-
Notifications
You must be signed in to change notification settings - Fork 259
env_process: allow creating the dir while it exists #4238
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
📝 WalkthroughWalkthroughAdjusts directory creation in preprocess_fs_source for fs_type "mount" when fs_source_user_config == "no" to call os.makedirs(fs_source, exist_ok=True), making creation tolerant of an already-existing directory; surrounding removal/recreation logic is unchanged. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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). (1)
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 |
|
@YongxueHong Could you please help to take a review here? Thanks |
|
Hi @hellohellenmao |
sometimes there is already the dir created and not mounted or anything else before the test execution. And currently though the code checks os.path.exists(), but while removing the dir, it ignore_errors=True, which means that whatever the remove sucesses or not, it will keep on running. So os.makedir() fails for the dir exists sometimes. so adding exist_ok=True for os.makedir() will allow dir creation althrough the dir exits. Signed-off-by: Tingting Mao <[email protected]>
d9b070f to
507c8fa
Compare
Sure, updated. Review again, please. |
YongxueHong
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.
fbq815
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:
(1/3)unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.s390-virtio: PASS (377.62 s)
(2/3) virtio_fs_multi_vms.with_multi_fs_sources.s390-virtio: PASS (49.11 s)
(3/3) virtio_fs_multi_vms.share_fs_source.s390-virtio: PASS (49.16 s)
re-run:
|
If there are existing files in the test folder, they may affect the test results. Could you please take this into account? @hellohellenmao |
Hi @xiagao , with the changes here, creating the dir will success even though there are files in the test folder. And I believe that if the user are calling |
@xiagao Could you please help to check out here? Thanks |
I mean if the directory already exists, its contents will remain unchanged. os.makedirs() never deletes or overwrites files. |
So my patch here is to resolve this issue, with |
Hi, tingting |
Yeah, you're right. Thanks for pointing this out. And I remember that |
It looks good to me. And I don't know why ignore_errors=True here, is there risk to remove it? |
set exist_ok=True for os.makedirs function
ID: 3442
Summary by CodeRabbit