Merge branch 'paramiko-termcap' of git://github.com/madduck/ansible into testing
This commit is contained in:
commit
93f73739d3
1 changed files with 6 additions and 1 deletions
|
@ -110,7 +110,6 @@ class Connection(object):
|
||||||
if len(str(e)) > 0:
|
if len(str(e)) > 0:
|
||||||
msg += ": %s" % str(e)
|
msg += ": %s" % str(e)
|
||||||
raise errors.AnsibleConnectionFailed(msg)
|
raise errors.AnsibleConnectionFailed(msg)
|
||||||
chan.get_pty()
|
|
||||||
|
|
||||||
if not self.runner.sudo or not sudoable:
|
if not self.runner.sudo or not sudoable:
|
||||||
if executable:
|
if executable:
|
||||||
|
@ -120,6 +119,12 @@ class Connection(object):
|
||||||
vvv("EXEC %s" % quoted_command, host=self.host)
|
vvv("EXEC %s" % quoted_command, host=self.host)
|
||||||
chan.exec_command(quoted_command)
|
chan.exec_command(quoted_command)
|
||||||
else:
|
else:
|
||||||
|
# sudo usually requires a PTY (cf. requiretty option), therefore
|
||||||
|
# we give it one, and we try to initialise from the calling
|
||||||
|
# environment
|
||||||
|
chan.get_pty(term=os.getenv('TERM', 'vt100'),
|
||||||
|
width=os.getenv('COLUMNS', 0),
|
||||||
|
height=os.getenv('LINES', 0))
|
||||||
shcmd, prompt = utils.make_sudo_cmd(sudo_user, executable, cmd)
|
shcmd, prompt = utils.make_sudo_cmd(sudo_user, executable, cmd)
|
||||||
vvv("EXEC %s" % shcmd, host=self.host)
|
vvv("EXEC %s" % shcmd, host=self.host)
|
||||||
sudo_output = ''
|
sudo_output = ''
|
||||||
|
|
Loading…
Add table
Reference in a new issue