pyflakes fixes (mostly unused imports, unused vars)

This commit is contained in:
Michael DeHaan 2012-10-30 20:47:05 -04:00
parent c0747b7baa
commit be300b562a
4 changed files with 3 additions and 22 deletions

View file

@ -18,7 +18,6 @@
#######################################################
import os
import sys
import getpass

View file

@ -18,7 +18,6 @@
import os
import pwd
import ConfigParser
import traceback
def get_config(p, section, key, env_var, default):
if env_var is not None:

View file

@ -15,22 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import sys
import os
import shlex
import re
import codecs
import jinja2
import yaml
import operator
import json
from ansible import errors
from ansible import __version__
import ansible.constants as C
import time
import StringIO
import imp
import glob
import subprocess
import datetime
import pwd
@ -87,7 +80,6 @@ def _varFind(text, vars, depth=0):
is_complex = False
brace_level = 0
end = var_start
path = []
part_start = (var_start, brace_level)
space = vars
while end < len(text) and ((is_complex and brace_level > 0) or not is_complex):
@ -195,10 +187,7 @@ def varReplaceWithItems(basedir, varname, vars):
if not m:
return varname
if m['start'] == 0 and m['end'] == len(varname):
try:
return varReplaceWithItems(basedir, m['replacement'], vars)
except VarNotFoundException:
return varname
return varReplaceWithItems(basedir, m['replacement'], vars)
else:
return template(basedir, varname, vars)
elif isinstance(varname, (list, tuple)):
@ -214,7 +203,6 @@ def varReplaceWithItems(basedir, varname, vars):
def template(basedir, text, vars, expand_lists=False):
''' run a text buffer through the templating engine until it no longer changes '''
prev_text = ''
try:
text = text.decode('utf-8')
except UnicodeEncodeError:

View file

@ -18,9 +18,6 @@
import sys
import os
import shlex
import re
import codecs
import jinja2
import yaml
import optparse
import operator
@ -32,12 +29,9 @@ import time
import StringIO
import imp
import glob
import subprocess
import stat
import termios
import tty
import datetime
import pwd
VERBOSITY=0
@ -60,6 +54,7 @@ except:
KEYCZAR_AVAILABLE=False
try:
import keyczar.errors as key_errors
from keyczar.keys import AesKey
KEYCZAR_AVAILABLE=True
except ImportError:
@ -99,7 +94,7 @@ def encrypt(key, msg):
def decrypt(key, msg):
try:
return key.Decrypt(msg)
except keyczar.errors.InvalidSignatureError:
except key_errors.InvalidSignatureError:
raise errors.AnsibleError("decryption failed")
###############################################################