From 061394fff76208ff54c49e0d3583a29c77fc7ee9 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 2 Nov 2013 11:29:40 +0100 Subject: [PATCH 1/3] make pyflakes a bit more silent - explictely import json, since this is used ( only to silence pyflakes) - remove shutil as it is unused --- library/utilities/accelerate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/utilities/accelerate b/library/utilities/accelerate index d8b4f0b176..e44bca71d6 100644 --- a/library/utilities/accelerate +++ b/library/utilities/accelerate @@ -72,9 +72,9 @@ EXAMPLES = ''' import base64 import getpass +import json import os import os.path -import shutil import signal import socket import struct From eb77ca80dfc1055c4fd7862aefff94be64647439 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 2 Nov 2013 11:31:02 +0100 Subject: [PATCH 2/3] remove unused variable (pyflakes) --- library/utilities/accelerate | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/utilities/accelerate b/library/utilities/accelerate index e44bca71d6..38a96caba1 100644 --- a/library/utilities/accelerate +++ b/library/utilities/accelerate @@ -360,13 +360,11 @@ class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): return dict(failed=True, msg='internal error: out_path is required') final_path = None - final_user = None if 'user' in data and data.get('user') != getpass.getuser(): vv("the target user doesn't match this user, we'll move the file into place via sudo") (fd,out_path) = tempfile.mkstemp(prefix='ansible.', dir=os.path.expanduser('~/.ansible/tmp/')) out_fd = os.fdopen(fd, 'w', 0) final_path = data['out_path'] - final_user = data['user'] else: out_path = data['out_path'] out_fd = open(out_path, 'w') From ea6567dbf76f3b7645954c00c8314378794f779c Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 2 Nov 2013 11:32:54 +0100 Subject: [PATCH 3/3] fix incorrect send_data call. there is no client variable, and send_data is a class method. Pyflakes complained about it. --- library/utilities/accelerate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/utilities/accelerate b/library/utilities/accelerate index 38a96caba1..9b79ca3649 100644 --- a/library/utilities/accelerate +++ b/library/utilities/accelerate @@ -250,7 +250,7 @@ class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): vv("bad decrypt, skipping...") data2 = json.dumps(dict(rc=1)) data2 = self.server.key.Encrypt(data2) - send_data(client, data2) + self.send_data(data2) return vvvv("loading json from the data")