summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/installutils.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-08-11 17:08:09 -0400
committerRob Crittenden <rcritten@redhat.com>2009-08-12 13:18:15 -0400
commit8780751330871033b13fc8fbb7eb0588baf4417d (patch)
tree0b21cac0974b193c67c43e22fb7b21983766fbf8 /ipaserver/install/installutils.py
parentc781e8a57d3d05fa07729dbccff07bc1fab9d8e8 (diff)
downloadfreeipa-8780751330871033b13fc8fbb7eb0588baf4417d.tar.gz
freeipa-8780751330871033b13fc8fbb7eb0588baf4417d.tar.xz
freeipa-8780751330871033b13fc8fbb7eb0588baf4417d.zip
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.
Diffstat (limited to 'ipaserver/install/installutils.py')
-rw-r--r--ipaserver/install/installutils.py17
1 files changed, 8 insertions, 9 deletions
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.
"""