-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
blockinfile: do not crash when filename has no path #81638
Conversation
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.
otherwise code lgtm
path: "empty.txt" | ||
block: Hello. | ||
state: present | ||
create: yes |
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.
test should be in block and have an 'always' section that removes the file created
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.
code looks good, fix test and we can merge
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
* Do not crash when filename has no path. * Clean up file after test. (cherry picked from commit e659c23)
* Do not crash when filename has no path. * Clean up file after test. (cherry picked from commit e659c23)
SUMMARY
When
path
has no/
in it andcreate=true
, the module callsos.makedirs('')
, resulting in a crash.Fixes ansible-collections/community.general#7207.
ISSUE TYPE