View | Details | Raw Unified | Return to bug 190882
Collapse All | Expand All

(-)Makefile (-2 / +2 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	ansible
4
PORTNAME=	ansible
5
PORTVERSION=	1.6.2
5
PORTVERSION=	1.6.3
6
CATEGORIES=	sysutils python
6
CATEGORIES=	sysutils python
7
MASTER_SITES=	SF/lifanov-ports-distfiles/sysutils/${PORTNAME}/:icons
7
MASTER_SITES=	SF/lifanov-ports-distfiles/sysutils/${PORTNAME}/:icons
8
DISTFILES=	${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} \
8
DISTFILES=	${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} \
Lines 29-35 Link Here
29
GH_ACCOUNT=	${PORTNAME}
29
GH_ACCOUNT=	${PORTNAME}
30
GH_PROJECT=	${PORTNAME}
30
GH_PROJECT=	${PORTNAME}
31
GH_TAGNAME=	${GH_COMMIT}
31
GH_TAGNAME=	${GH_COMMIT}
32
GH_COMMIT=	ce4883b
32
GH_COMMIT=	dffea7f
33
33
34
USE_PYTHON=		2
34
USE_PYTHON=		2
35
USE_PYDISTUTILS=	yes
35
USE_PYDISTUTILS=	yes
(-)distinfo (-2 / +2 lines)
Lines 1-4 Link Here
1
SHA256 (ansible-1.6.2.tar.gz) = 38f90f99c73f4cb9217d07246c851d685d804588b0721de6e31441a1796388ef
1
SHA256 (ansible-1.6.3.tar.gz) = de4ef54c26768800843bbd01dc6f51d2be607bcfc41169ca7caf0cbd7f928d6b
2
SIZE (ansible-1.6.2.tar.gz) = 1174221
2
SIZE (ansible-1.6.3.tar.gz) = 1174852
3
SHA256 (ansible.png) = 9bf68abd2c95db4dc8dfc091c0e0e0a9716891f28d157e3f04e541d96e1c6850
3
SHA256 (ansible.png) = 9bf68abd2c95db4dc8dfc091c0e0e0a9716891f28d157e3f04e541d96e1c6850
4
SIZE (ansible.png) = 1160
4
SIZE (ansible.png) = 1160
(-)files/patch-lib__ansible__runner__connection_plugins__paramiko_ssh.py (-29 lines)
Lines 1-29 Link Here
1
--- ./lib/ansible/runner/connection_plugins/paramiko_ssh.py.orig	2014-05-23 16:37:57.000000000 -0400
2
+++ ./lib/ansible/runner/connection_plugins/paramiko_ssh.py	2014-05-31 09:13:44.137967396 -0400
3
@@ -31,6 +31,7 @@
4
 import logging
5
 import traceback
6
 import fcntl
7
+import re
8
 import sys
9
 from termios import tcflush, TCIFLUSH
10
 from binascii import hexlify
11
@@ -210,12 +211,17 @@
12
                 shcmd, prompt, success_key = utils.make_sudo_cmd(sudo_user, executable, cmd)
13
             elif self.runner.su or su:
14
                 shcmd, prompt, success_key = utils.make_su_cmd(su_user, executable, cmd)
15
+                prompt_re = re.compile(prompt)
16
             vvv("EXEC %s" % shcmd, host=self.host)
17
             sudo_output = ''
18
             try:
19
                 chan.exec_command(shcmd)
20
                 if self.runner.sudo_pass or self.runner.su_pass:
21
-                    while not sudo_output.endswith(prompt) and success_key not in sudo_output:
22
+                    while True:
23
+                        if success_key in sudo_output or \
24
+                            (self.runner.sudo_pass and sudo_output.endswith(prompt)) or \
25
+                            (self.runner.su_pass and prompt_re.match(sudo_output)):
26
+                            break
27
                         chunk = chan.recv(bufsize)
28
                         if not chunk:
29
                             if 'unknown user' in sudo_output:
(-)files/patch-lib__ansible__runner__connection_plugins__ssh.py (-32 lines)
Lines 1-32 Link Here
1
--- ./lib/ansible/runner/connection_plugins/ssh.py.orig	2014-05-23 16:37:57.000000000 -0400
2
+++ ./lib/ansible/runner/connection_plugins/ssh.py	2014-05-31 09:13:44.138967431 -0400
3
@@ -17,6 +17,7 @@
4
 #
5
 
6
 import os
7
+import re
8
 import subprocess
9
 import shlex
10
 import pipes
11
@@ -263,6 +264,7 @@
12
 
13
         if su and su_user:
14
             sudocmd, prompt, success_key = utils.make_su_cmd(su_user, executable, cmd)
15
+            prompt_re = re.compile(prompt)
16
             ssh_cmd.append(sudocmd)
17
         elif not self.runner.sudo or not sudoable:
18
             prompt = None
19
@@ -303,7 +305,12 @@
20
             sudo_output = ''
21
             sudo_errput = ''
22
 
23
-            while not sudo_output.endswith(prompt) and success_key not in sudo_output:
24
+            while True:
25
+                if success_key in sudo_output or \
26
+                    (self.runner.sudo_pass and sudo_output.endswith(prompt)) or \
27
+                    (self.runner.su_pass and prompt_re.match(sudo_output)):
28
+                    break
29
+
30
                 rfd, wfd, efd = select.select([p.stdout, p.stderr], [],
31
                                               [p.stdout], self.runner.timeout)
32
                 if p.stderr in rfd:
(-)files/patch-lib__ansible__utils____init__.py (-14 lines)
Lines 1-14 Link Here
1
--- ./lib/ansible/utils/__init__.py.orig	2014-05-23 16:37:57.000000000 -0400
2
+++ ./lib/ansible/utils/__init__.py	2014-05-31 09:13:44.140967223 -0400
3
@@ -952,9 +952,9 @@
4
     """
5
     # TODO: work on this function
6
     randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32))
7
-    prompt = 'assword: '
8
+    prompt = '[Pp]assword: ?$'
9
     success_key = 'SUDO-SUCCESS-%s' % randbits
10
-    sudocmd = '%s %s %s %s -c %s' % (
11
+    sudocmd = '%s %s %s -c "%s -c %s"' % (
12
         C.DEFAULT_SU_EXE, C.DEFAULT_SU_FLAGS, su_user, executable or '$SHELL',
13
         pipes.quote('echo %s; %s' % (success_key, cmd))
14
     )
(-)files/patch-test__units__TestUtils.py (-21 lines)
Lines 1-21 Link Here
1
--- ./test/units/TestUtils.py.orig	2014-05-23 16:37:57.000000000 -0400
2
+++ ./test/units/TestUtils.py	2014-05-31 09:13:44.141967206 -0400
3
@@ -3,6 +3,7 @@
4
 import unittest
5
 import os
6
 import os.path
7
+import re
8
 import tempfile
9
 import yaml
10
 import passlib.hash
11
@@ -511,8 +512,8 @@
12
         cmd = ansible.utils.make_su_cmd('root', '/bin/sh', '/bin/ls')
13
         self.assertTrue(isinstance(cmd, tuple))
14
         self.assertEqual(len(cmd), 3)
15
-        self.assertTrue(' root /bin/sh' in cmd[0])
16
-        self.assertTrue(cmd[1] == 'assword: ')
17
+        self.assertTrue(' root -c "/bin/sh' in cmd[0])
18
+        self.assertTrue(re.compile(cmd[1]))
19
         self.assertTrue('echo SUDO-SUCCESS-' in cmd[0] and cmd[2].startswith('SUDO-SUCCESS-'))
20
 
21
     def test_to_unicode(self):

Return to bug 190882