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
7133734d
Commit
7133734d
authored
Mar 28, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove debug statements (WIP on sudo)
parent
4971101f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
lib/ansible/connection.py
+17
-7
lib/ansible/runner.py
+0
-2
No files found.
lib/ansible/connection.py
View file @
7133734d
...
...
@@ -58,27 +58,37 @@ class ParamikoConnection(object):
self
.
ssh
=
paramiko
.
SSHClient
()
self
.
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
try
:
self
.
ssh
.
connect
(
self
.
host
,
username
=
self
.
runner
.
remote_user
,
allow_agent
=
True
,
look_for_keys
=
True
,
password
=
self
.
runner
.
remote_pass
,
timeout
=
self
.
runner
.
timeout
,
port
=
self
.
runner
.
remote_port
self
.
host
,
username
=
self
.
runner
.
remote_user
,
allow_agent
=
True
,
look_for_keys
=
True
,
password
=
self
.
runner
.
remote_pass
,
timeout
=
self
.
runner
.
timeout
,
port
=
self
.
runner
.
remote_port
)
except
Exception
,
e
:
if
str
(
e
)
.
find
(
"PID check failed"
)
!=
-
1
:
raise
errors
.
AnsibleError
(
"paramiko version issue, please upgrade paramiko on the machine running ansible"
)
else
:
raise
errors
.
AnsibleConnectionFailed
(
str
(
e
))
return
self
def
exec_command
(
self
,
cmd
):
''' run a command on the remote host '''
#if not False:
stdin
,
stdout
,
stderr
=
self
.
ssh
.
exec_command
(
cmd
)
return
(
stdin
,
stdout
,
stderr
)
#else:
# sudo_chan = self.ssh.get_transport().open_session()
# sudo_chan = chan.get_pty()
# sudo_chan.exec_command("sudo %s" % cmd)
# output = channel.makefile('rb', -1).readlines()
# if not output:
# output = channel.makefile_stderr('rb', -1).readlines()
# print "DEBUG: output: %s" % output
# channel.close()
# return (None, '', output)
def
put_file
(
self
,
in_path
,
out_path
):
''' transfer a file from local to remote '''
...
...
lib/ansible/runner.py
View file @
7133734d
...
...
@@ -36,10 +36,8 @@ from ansible import callbacks as ans_callbacks
HAS_ATFORK
=
True
try
:
print
"DEBUG: I have atfork"
from
Crypto.Random
import
atfork
except
ImportError
:
print
"DEBUG: I have no atfork, this won't help my problem"
HAS_ATFORK
=
False
################################################
...
...
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