#82 Remove unned print, fix python 3 support

This commit is contained in:
nvbn
2015-04-21 22:10:53 +02:00
parent 3df77b5bad
commit d1416a6c2a
2 changed files with 5 additions and 11 deletions
+1 -2
View File
@@ -1,4 +1,5 @@
import re
patterns = [
r'WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!',
r'WARNING: POSSIBLE DNS SPOOFING DETECTED!',
@@ -23,12 +24,10 @@ def match(command, settings):
def remove_offending_keys(command, settings):
offending = offending_pattern.findall(command.stderr)
print offending
for filepath, lineno in offending:
with open(filepath, 'r') as fh:
lines = fh.readlines()
del lines[int(lineno) - 1]
print lines
with open(filepath, 'w') as fh:
fh.writelines(lines)