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.
pull/2106/head
Maykel Moya 12 years ago
parent a875b63703
commit 8b27085c34

@ -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()

Loading…
Cancel
Save