aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Bouchard <louis.bouchard@canonical.com>2013-04-15 14:31:20 +0200
committerLouis Bouchard <louis.bouchard@canonical.com>2013-04-15 14:31:20 +0200
commit9160ec527bb361945fa747c3071d18066491366b (patch)
tree161681eaaf72a86f89d965a00990e0c27abbaa25
parentc7625fa0cd36b9df85e9ac6c6af8f5f51cfb6e6b (diff)
downloadsos-9160ec527bb361945fa747c3071d18066491366b.tar.gz
fix get_dns_dir which backtraces if regex is not found
-rw-r--r--sos/plugins/named.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sos/plugins/named.py b/sos/plugins/named.py
index 812e20da..83dc6b22 100644
--- a/sos/plugins/named.py
+++ b/sos/plugins/named.py
@@ -27,7 +27,10 @@ class named(Plugin, RedHatPlugin):
""" grab directory path from named{conf,boot}
"""
directory_list = self.do_regex_find_all("directory\s+\"(.*)\"", config_file)
- return normpath(directory_list[0])
+ if directory_list:
+ return normpath(directory_list[0])
+ else:
+ return ""
def setup(self):
config_files = ("/etc/named.conf",