Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
a44ea2d1
Commit
a44ea2d1
authored
Sep 15, 2014
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not keep a new file if we fail to set its attributes.
parent
cdf938f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
library/files/file
+10
-2
No files found.
library/files/file
View file @
a44ea2d1
...
@@ -331,8 +331,16 @@ def main():
...
@@ -331,8 +331,16 @@ def main():
module
.
fail_json
(
path
=
path
,
msg
=
'Error while touching existing target:
%
s'
%
str
(
e
))
module
.
fail_json
(
path
=
path
,
msg
=
'Error while touching existing target:
%
s'
%
str
(
e
))
else
:
else
:
module
.
fail_json
(
msg
=
'Cannot touch other than files and directories'
)
module
.
fail_json
(
msg
=
'Cannot touch other than files and directories'
)
try
:
module
.
set_fs_attributes_if_different
(
file_args
,
True
)
module
.
set_fs_attributes_if_different
(
file_args
,
True
)
except
SystemExit
as
e
:
if
e
.
code
:
# We take this to mean that fail_json() was called from
# somewhere in basic.py
if
prev_state
==
'absent'
:
# If we just created the file we can safely remove it
os
.
remove
(
path
)
raise
e
module
.
exit_json
(
dest
=
path
,
changed
=
True
)
module
.
exit_json
(
dest
=
path
,
changed
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment