From 8b27085c347cc74b4f3545cf3bbe5843c03bcf3c Mon Sep 17 00:00:00 2001 From: Maykel Moya Date: Wed, 13 Feb 2013 02:01:58 +0100 Subject: [PATCH] Prevent traceback when /etc/mtab is not available * get_file_contents returns None when file is not available. When /etc/mtab is pointing to /proc/mounts and /proc is not mounted, mtab.split will traceback. --- library/setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/setup b/library/setup index fab87244c28..2080631ab3a 100644 --- a/library/setup +++ b/library/setup @@ -388,7 +388,7 @@ class LinuxHardware(Hardware): def get_mount_facts(self): self.facts['mounts'] = [] - mtab = get_file_content('/etc/mtab') + mtab = get_file_content('/etc/mtab', '') for line in mtab.split('\n'): if line.startswith('/'): fields = line.rstrip('\n').split()