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
4d451294
Commit
4d451294
authored
Jul 01, 2015
by
Pierre-Louis Bonicoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix "AttributeError: 'ActionModule' object has no attribute '_shell'"
'_shell' was removed with commit
2a5fbd85
parent
a155f65a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
15 deletions
+15
-15
lib/ansible/plugins/action/async.py
+3
-3
lib/ansible/plugins/action/copy.py
+6
-6
lib/ansible/plugins/action/fetch.py
+2
-2
lib/ansible/plugins/action/patch.py
+1
-1
lib/ansible/plugins/action/script.py
+1
-1
lib/ansible/plugins/action/template.py
+2
-2
No files found.
lib/ansible/plugins/action/async.py
View file @
4d451294
...
...
@@ -36,8 +36,8 @@ class ActionModule(ActionBase):
tmp
=
self
.
_make_tmp_path
()
module_name
=
self
.
_task
.
action
async_module_path
=
self
.
_shell
.
join_path
(
tmp
,
'async_wrapper'
)
remote_module_path
=
self
.
_shell
.
join_path
(
tmp
,
module_name
)
async_module_path
=
self
.
_
connection
.
_
shell
.
join_path
(
tmp
,
'async_wrapper'
)
remote_module_path
=
self
.
_
connection
.
_
shell
.
join_path
(
tmp
,
module_name
)
env_string
=
self
.
_compute_environment_string
()
...
...
@@ -51,7 +51,7 @@ class ActionModule(ActionBase):
self
.
_transfer_data
(
async_module_path
,
async_module_data
)
self
.
_remote_chmod
(
tmp
,
'a+rx'
,
async_module_path
)
argsfile
=
self
.
_transfer_data
(
self
.
_shell
.
join_path
(
tmp
,
'arguments'
),
json
.
dumps
(
self
.
_task
.
args
))
argsfile
=
self
.
_transfer_data
(
self
.
_
connection
.
_
shell
.
join_path
(
tmp
,
'arguments'
),
json
.
dumps
(
self
.
_task
.
args
))
async_limit
=
self
.
_task
.
async
async_jid
=
str
(
random
.
randint
(
0
,
999999999999
))
...
...
lib/ansible/plugins/action/copy.py
View file @
4d451294
...
...
@@ -115,8 +115,8 @@ class ActionModule(ActionBase):
# If it's recursive copy, destination is always a dir,
# explicitly mark it so (note - copy module relies on this).
if
not
self
.
_shell
.
path_has_trailing_slash
(
dest
):
dest
=
self
.
_shell
.
join_path
(
dest
,
''
)
if
not
self
.
_
connection
.
_
shell
.
path_has_trailing_slash
(
dest
):
dest
=
self
.
_
connection
.
_
shell
.
join_path
(
dest
,
''
)
else
:
source_files
.
append
((
source
,
os
.
path
.
basename
(
source
)))
...
...
@@ -151,10 +151,10 @@ class ActionModule(ActionBase):
# This is kind of optimization - if user told us destination is
# dir, do path manipulation right away, otherwise we still check
# for dest being a dir via remote call below.
if
self
.
_shell
.
path_has_trailing_slash
(
dest
):
dest_file
=
self
.
_shell
.
join_path
(
dest
,
source_rel
)
if
self
.
_
connection
.
_
shell
.
path_has_trailing_slash
(
dest
):
dest_file
=
self
.
_
connection
.
_
shell
.
join_path
(
dest
,
source_rel
)
else
:
dest_file
=
self
.
_shell
.
join_path
(
dest
)
dest_file
=
self
.
_
connection
.
_
shell
.
join_path
(
dest
)
# Attempt to get the remote checksum
remote_checksum
=
self
.
_remote_checksum
(
tmp
,
dest_file
)
...
...
@@ -167,7 +167,7 @@ class ActionModule(ActionBase):
return
dict
(
failed
=
True
,
msg
=
"can not use content with a dir as dest"
)
else
:
# Append the relative source location to the destination and retry remote_checksum
dest_file
=
self
.
_shell
.
join_path
(
dest
,
source_rel
)
dest_file
=
self
.
_
connection
.
_
shell
.
join_path
(
dest
,
source_rel
)
remote_checksum
=
self
.
_remote_checksum
(
tmp
,
dest_file
)
if
remote_checksum
!=
'1'
and
not
force
:
...
...
lib/ansible/plugins/action/fetch.py
View file @
4d451294
...
...
@@ -52,7 +52,7 @@ class ActionModule(ActionBase):
if
source
is
None
or
dest
is
None
:
return
dict
(
failed
=
True
,
msg
=
"src and dest are required"
)
source
=
self
.
_shell
.
join_path
(
source
)
source
=
self
.
_
connection
.
_
shell
.
join_path
(
source
)
source
=
self
.
_remote_expand_user
(
source
,
tmp
)
# calculate checksum for the remote file
...
...
@@ -78,7 +78,7 @@ class ActionModule(ActionBase):
pass
# calculate the destination name
if
os
.
path
.
sep
not
in
self
.
_shell
.
join_path
(
'a'
,
''
):
if
os
.
path
.
sep
not
in
self
.
_
connection
.
_
shell
.
join_path
(
'a'
,
''
):
source_local
=
source
.
replace
(
'
\\
'
,
'/'
)
else
:
source_local
=
source
...
...
lib/ansible/plugins/action/patch.py
View file @
4d451294
...
...
@@ -47,7 +47,7 @@ class ActionModule(ActionBase):
if
tmp
is
None
or
"-tmp-"
not
in
tmp
:
tmp
=
self
.
_make_tmp_path
()
tmp_src
=
self
.
_shell
.
join_path
(
tmp
,
os
.
path
.
basename
(
src
))
tmp_src
=
self
.
_
connection
.
_
shell
.
join_path
(
tmp
,
os
.
path
.
basename
(
src
))
self
.
_connection
.
put_file
(
src
,
tmp_src
)
if
self
.
_connection_info
.
become
and
self
.
_connection_info
.
become_user
!=
'root'
:
...
...
lib/ansible/plugins/action/script.py
View file @
4d451294
...
...
@@ -71,7 +71,7 @@ class ActionModule(ActionBase):
source
=
self
.
_loader
.
path_dwim
(
source
)
# transfer the file to a remote tmp location
tmp_src
=
self
.
_shell
.
join_path
(
tmp
,
os
.
path
.
basename
(
source
))
tmp_src
=
self
.
_
connection
.
_
shell
.
join_path
(
tmp
,
os
.
path
.
basename
(
source
))
self
.
_connection
.
put_file
(
source
,
tmp_src
)
sudoable
=
True
...
...
lib/ansible/plugins/action/template.py
View file @
4d451294
...
...
@@ -121,8 +121,8 @@ class ActionModule(ActionBase):
# dest_contents = base64.b64decode(dest_contents)
# else:
# raise Exception("unknown encoding, failed: %s" % dest_result.result)
xfered
=
self
.
_transfer_data
(
self
.
_shell
.
join_path
(
tmp
,
'source'
),
resultant
)
xfered
=
self
.
_transfer_data
(
self
.
_
connection
.
_
shell
.
join_path
(
tmp
,
'source'
),
resultant
)
# fix file permissions when the copy is done as a different user
if
self
.
_connection_info
.
become
and
self
.
_connection_info
.
become_user
!=
'root'
:
...
...
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