diff options
author | tdb <tdb@FreeBSD.org> | 2014-05-31 22:01:00 +0800 |
---|---|---|
committer | tdb <tdb@FreeBSD.org> | 2014-05-31 22:01:00 +0800 |
commit | 93b890454af1770a1344a1a73d74189c5565aad9 (patch) | |
tree | b71bc749181c8b935ca23fa2f0cce8e790b3e251 /sysutils | |
parent | d386560aa620cecbd06ac169133df7a4addebf2c (diff) | |
download | freebsd-ports-gnome-93b890454af1770a1344a1a73d74189c5565aad9.tar.gz freebsd-ports-gnome-93b890454af1770a1344a1a73d74189c5565aad9.tar.zst freebsd-ports-gnome-93b890454af1770a1344a1a73d74189c5565aad9.zip |
- Update to 1.6.2
- Include patch from https://github.com/ansible/ansible/pull/7539
Changes to what's given in the PR were discussed and submitted by
email.
PR: ports/190231
Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com> (maintainer)
Diffstat (limited to 'sysutils')
6 files changed, 100 insertions, 4 deletions
diff --git a/sysutils/ansible/Makefile b/sysutils/ansible/Makefile index 6020ea5d70c0..12a4072b4e44 100644 --- a/sysutils/ansible/Makefile +++ b/sysutils/ansible/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= ansible -PORTVERSION= 1.6.1 +PORTVERSION= 1.6.2 CATEGORIES= sysutils python MASTER_SITES= SF/lifanov-ports-distfiles/sysutils/${PORTNAME}/:icons DISTFILES= ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} \ @@ -29,7 +29,7 @@ USE_GITHUB= yes GH_ACCOUNT= ${PORTNAME} GH_PROJECT= ${PORTNAME} GH_TAGNAME= ${GH_COMMIT} -GH_COMMIT= d4e11c5 +GH_COMMIT= ce4883b USE_PYTHON= 2 USE_PYDISTUTILS= yes diff --git a/sysutils/ansible/distinfo b/sysutils/ansible/distinfo index 7cde3ba411a1..f7d3e98f5e76 100644 --- a/sysutils/ansible/distinfo +++ b/sysutils/ansible/distinfo @@ -1,4 +1,4 @@ -SHA256 (ansible-1.6.1.tar.gz) = 02cc980c397d6edabd1353d03a943f4a5931018b6d9caa69a513c68743a3a8b2 -SIZE (ansible-1.6.1.tar.gz) = 1171854 +SHA256 (ansible-1.6.2.tar.gz) = 38f90f99c73f4cb9217d07246c851d685d804588b0721de6e31441a1796388ef +SIZE (ansible-1.6.2.tar.gz) = 1174221 SHA256 (ansible.png) = 9bf68abd2c95db4dc8dfc091c0e0e0a9716891f28d157e3f04e541d96e1c6850 SIZE (ansible.png) = 1160 diff --git a/sysutils/ansible/files/patch-lib__ansible__runner__connection_plugins__paramiko_ssh.py b/sysutils/ansible/files/patch-lib__ansible__runner__connection_plugins__paramiko_ssh.py new file mode 100644 index 000000000000..4af120aca94a --- /dev/null +++ b/sysutils/ansible/files/patch-lib__ansible__runner__connection_plugins__paramiko_ssh.py @@ -0,0 +1,29 @@ +--- ./lib/ansible/runner/connection_plugins/paramiko_ssh.py.orig 2014-05-23 16:37:57.000000000 -0400 ++++ ./lib/ansible/runner/connection_plugins/paramiko_ssh.py 2014-05-31 09:13:44.137967396 -0400 +@@ -31,6 +31,7 @@ + import logging + import traceback + import fcntl ++import re + import sys + from termios import tcflush, TCIFLUSH + from binascii import hexlify +@@ -210,12 +211,17 @@ + shcmd, prompt, success_key = utils.make_sudo_cmd(sudo_user, executable, cmd) + elif self.runner.su or su: + shcmd, prompt, success_key = utils.make_su_cmd(su_user, executable, cmd) ++ prompt_re = re.compile(prompt) + vvv("EXEC %s" % shcmd, host=self.host) + sudo_output = '' + try: + chan.exec_command(shcmd) + if self.runner.sudo_pass or self.runner.su_pass: +- while not sudo_output.endswith(prompt) and success_key not in sudo_output: ++ while True: ++ if success_key in sudo_output or \ ++ (self.runner.sudo_pass and sudo_output.endswith(prompt)) or \ ++ (self.runner.su_pass and prompt_re.match(sudo_output)): ++ break + chunk = chan.recv(bufsize) + if not chunk: + if 'unknown user' in sudo_output: diff --git a/sysutils/ansible/files/patch-lib__ansible__runner__connection_plugins__ssh.py b/sysutils/ansible/files/patch-lib__ansible__runner__connection_plugins__ssh.py new file mode 100644 index 000000000000..69fc5a8987fc --- /dev/null +++ b/sysutils/ansible/files/patch-lib__ansible__runner__connection_plugins__ssh.py @@ -0,0 +1,32 @@ +--- ./lib/ansible/runner/connection_plugins/ssh.py.orig 2014-05-23 16:37:57.000000000 -0400 ++++ ./lib/ansible/runner/connection_plugins/ssh.py 2014-05-31 09:13:44.138967431 -0400 +@@ -17,6 +17,7 @@ + # + + import os ++import re + import subprocess + import shlex + import pipes +@@ -263,6 +264,7 @@ + + if su and su_user: + sudocmd, prompt, success_key = utils.make_su_cmd(su_user, executable, cmd) ++ prompt_re = re.compile(prompt) + ssh_cmd.append(sudocmd) + elif not self.runner.sudo or not sudoable: + prompt = None +@@ -303,7 +305,12 @@ + sudo_output = '' + sudo_errput = '' + +- while not sudo_output.endswith(prompt) and success_key not in sudo_output: ++ while True: ++ if success_key in sudo_output or \ ++ (self.runner.sudo_pass and sudo_output.endswith(prompt)) or \ ++ (self.runner.su_pass and prompt_re.match(sudo_output)): ++ break ++ + rfd, wfd, efd = select.select([p.stdout, p.stderr], [], + [p.stdout], self.runner.timeout) + if p.stderr in rfd: diff --git a/sysutils/ansible/files/patch-lib__ansible__utils____init__.py b/sysutils/ansible/files/patch-lib__ansible__utils____init__.py new file mode 100644 index 000000000000..cff58700738c --- /dev/null +++ b/sysutils/ansible/files/patch-lib__ansible__utils____init__.py @@ -0,0 +1,14 @@ +--- ./lib/ansible/utils/__init__.py.orig 2014-05-23 16:37:57.000000000 -0400 ++++ ./lib/ansible/utils/__init__.py 2014-05-31 09:13:44.140967223 -0400 +@@ -952,9 +952,9 @@ + """ + # TODO: work on this function + randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32)) +- prompt = 'assword: ' ++ prompt = '[Pp]assword: ?$' + success_key = 'SUDO-SUCCESS-%s' % randbits +- sudocmd = '%s %s %s %s -c %s' % ( ++ sudocmd = '%s %s %s -c "%s -c %s"' % ( + C.DEFAULT_SU_EXE, C.DEFAULT_SU_FLAGS, su_user, executable or '$SHELL', + pipes.quote('echo %s; %s' % (success_key, cmd)) + ) diff --git a/sysutils/ansible/files/patch-test__units__TestUtils.py b/sysutils/ansible/files/patch-test__units__TestUtils.py new file mode 100644 index 000000000000..88e47f850a09 --- /dev/null +++ b/sysutils/ansible/files/patch-test__units__TestUtils.py @@ -0,0 +1,21 @@ +--- ./test/units/TestUtils.py.orig 2014-05-23 16:37:57.000000000 -0400 ++++ ./test/units/TestUtils.py 2014-05-31 09:13:44.141967206 -0400 +@@ -3,6 +3,7 @@ + import unittest + import os + import os.path ++import re + import tempfile + import yaml + import passlib.hash +@@ -511,8 +512,8 @@ + cmd = ansible.utils.make_su_cmd('root', '/bin/sh', '/bin/ls') + self.assertTrue(isinstance(cmd, tuple)) + self.assertEqual(len(cmd), 3) +- self.assertTrue(' root /bin/sh' in cmd[0]) +- self.assertTrue(cmd[1] == 'assword: ') ++ self.assertTrue(' root -c "/bin/sh' in cmd[0]) ++ self.assertTrue(re.compile(cmd[1])) + self.assertTrue('echo SUDO-SUCCESS-' in cmd[0] and cmd[2].startswith('SUDO-SUCCESS-')) + + def test_to_unicode(self): |