Pylint and pep8 cleanups.
This commit is contained in:
parent
9562fbe233
commit
4fbc29f07e
@ -90,4 +90,3 @@ class HostsConf(object):
|
|||||||
pieces = "\t".join(pieces)
|
pieces = "\t".join(pieces)
|
||||||
contents.write("%s%s\n" % (pieces, tail))
|
contents.write("%s%s\n" % (pieces, tail))
|
||||||
return contents.getvalue()
|
return contents.getvalue()
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ class Distro(distros.Distro):
|
|||||||
self.package_command('install', pkglist)
|
self.package_command('install', pkglist)
|
||||||
|
|
||||||
def _adjust_resolve(self, dns_servers, search_servers):
|
def _adjust_resolve(self, dns_servers, search_servers):
|
||||||
r_conf = ResolvConf(util.load_file(self.resolve_conf_fn))
|
|
||||||
try:
|
try:
|
||||||
|
r_conf = ResolvConf(util.load_file(self.resolve_conf_fn))
|
||||||
r_conf.parse()
|
r_conf.parse()
|
||||||
except IOError:
|
except IOError:
|
||||||
util.logexc(LOG,
|
util.logexc(LOG,
|
||||||
@ -178,10 +178,10 @@ class Distro(distros.Distro):
|
|||||||
|
|
||||||
def _read_conf(self, fn):
|
def _read_conf(self, fn):
|
||||||
exists = False
|
exists = False
|
||||||
if os.path.isfile(fn):
|
try:
|
||||||
contents = util.load_file(fn).splitlines()
|
contents = util.load_file(fn).splitlines()
|
||||||
exists = True
|
exists = True
|
||||||
else:
|
except IOError:
|
||||||
contents = []
|
contents = []
|
||||||
return (exists,
|
return (exists,
|
||||||
SysConf(contents))
|
SysConf(contents))
|
||||||
|
@ -80,4 +80,3 @@ USEMD5=no'''
|
|||||||
contents = str(conf)
|
contents = str(conf)
|
||||||
self.assertIn("Z=d", contents)
|
self.assertIn("Z=d", contents)
|
||||||
self.assertIn("BLAH=b", contents)
|
self.assertIn("BLAH=b", contents)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user