summaryrefslogtreecommitdiff
path: root/cloudinit/distros/rhel.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-11-12 22:14:31 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-11-12 22:14:31 -0800
commitc8c2ff830f917a7ddecab21eeecb99a20c2e9805 (patch)
treed3ed7a7862d3c560aaf3c29f7c3f955ce4e46a70 /cloudinit/distros/rhel.py
parentd5aeda9535ab530fd2c09e6ad37443c9013c3b4d (diff)
downloadvyos-cloud-init-c8c2ff830f917a7ddecab21eeecb99a20c2e9805.tar.gz
vyos-cloud-init-c8c2ff830f917a7ddecab21eeecb99a20c2e9805.zip
Pylint and pep8 cleanups.
Diffstat (limited to 'cloudinit/distros/rhel.py')
-rw-r--r--cloudinit/distros/rhel.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py
index 7df01c62..bc0877d5 100644
--- a/cloudinit/distros/rhel.py
+++ b/cloudinit/distros/rhel.py
@@ -48,7 +48,7 @@ class Distro(distros.Distro):
clock_conf_fn = "/etc/sysconfig/clock"
locale_conf_fn = '/etc/sysconfig/i18n'
network_conf_fn = "/etc/sysconfig/network"
- hostname_conf_fn = "/etc/sysconfig/network"
+ hostname_conf_fn = "/etc/sysconfig/network"
network_script_tpl = '/etc/sysconfig/network-scripts/ifcfg-%s'
resolve_conf_fn = "/etc/resolv.conf"
tz_local_fn = "/etc/localtime"
@@ -65,11 +65,11 @@ class Distro(distros.Distro):
self.package_command('install', pkglist)
def _adjust_resolve(self, dns_servers, search_servers):
- r_conf = ResolvConf(util.load_file(self.resolve_conf_fn))
try:
+ r_conf = ResolvConf(util.load_file(self.resolve_conf_fn))
r_conf.parse()
except IOError:
- util.logexc(LOG,
+ util.logexc(LOG,
"Failed at parsing %s reverting to an empty instance",
self.resolve_conf_fn)
r_conf = ResolvConf('')
@@ -178,10 +178,10 @@ class Distro(distros.Distro):
def _read_conf(self, fn):
exists = False
- if os.path.isfile(fn):
+ try:
contents = util.load_file(fn).splitlines()
exists = True
- else:
+ except IOError:
contents = []
return (exists,
SysConf(contents))