From 8780751330871033b13fc8fbb7eb0588baf4417d Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 11 Aug 2009 17:08:09 -0400 Subject: Clean up some problems discovered with pylint and pychecker Much of this is formatting to make pylint happy but it also fixes some real bugs. --- ipaserver/install/installutils.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ipaserver/install/installutils.py') diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py index c1202371..a41176cc 100644 --- a/ipaserver/install/installutils.py +++ b/ipaserver/install/installutils.py @@ -25,7 +25,6 @@ import os import re import fileinput import sys -import time import struct import fcntl @@ -217,28 +216,28 @@ def set_directive(filename, directive, value, quotes=True, separator=' '): """ valueset = False fd = open(filename) - file = [] + newfile = [] for line in fd: if directive in line: valueset = True if quotes: - file.append('%s%s"%s"\n' % (directive, separator, value)) + newfile.append('%s%s"%s"\n' % (directive, separator, value)) else: - file.append('%s%s%s\n' % (directive, separator, value)) + newfile.append('%s%s%s\n' % (directive, separator, value)) else: - file.append(line) + newfile.append(line) fd.close() if not valueset: if quotes: - file.append('%s%s"%s"\n' % (directive, separator, value)) + newfile.append('%s%s"%s"\n' % (directive, separator, value)) else: - file.append('%s%s%s\n' % (directive, separator, value)) + newfile.append('%s%s%s\n' % (directive, separator, value)) fd = open(filename, "w") - fd.write("".join(file)) + fd.write("".join(newfile)) fd.close() -def get_directive(filename, directive, strip_quotes=True, separator=' '): +def get_directive(filename, directive, separator=' '): """ A rather inefficient way to get a configuration directive. """ -- cgit