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
f04af911
Commit
f04af911
authored
Sep 05, 2013
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When putting a file in accelerated mode, make sure it's chowned correctly
parent
68bffb12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
library/utilities/accelerate
+6
-0
No files found.
library/utilities/accelerate
View file @
f04af911
...
...
@@ -274,11 +274,13 @@ class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
return
dict
(
failed
=
True
,
msg
=
'internal error: out_path is required'
)
final_path
=
None
final_user
=
None
if
'user'
in
data
and
data
.
get
(
'user'
)
!=
getpass
.
getuser
():
log
(
"the target user doesn't match this user, we'll move the file into place via sudo"
)
(
fd
,
out_path
)
=
tempfile
.
mkstemp
(
prefix
=
'ansible.'
,
dir
=
os
.
path
.
expanduser
(
'~/.ansible/tmp/'
))
out_fd
=
os
.
fdopen
(
fd
,
'w'
,
0
)
final_path
=
data
[
'out_path'
]
final_user
=
data
[
'user'
]
else
:
out_path
=
data
[
'out_path'
]
out_fd
=
open
(
out_path
,
'w'
)
...
...
@@ -313,6 +315,10 @@ class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
rc
,
stdout
,
stderr
=
self
.
server
.
module
.
run_command
(
args
,
close_fds
=
True
)
if
rc
!=
0
:
return
dict
(
failed
=
True
,
stdout
=
"failed to copy the file into position with sudo"
)
args
=
[
'sudo'
,
'chown'
,
final_user
,
out_path
,
final_path
]
rc
,
stdout
,
stderr
=
self
.
server
.
module
.
run_command
(
args
,
close_fds
=
True
)
if
rc
!=
0
:
return
dict
(
failed
=
True
,
stdout
=
"failed to chown the file via sudo"
)
return
dict
()
def
daemonize
(
module
,
password
,
port
,
minutes
):
...
...
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