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.
reviewable/pr18780/r1
Maykel Moya 12 years ago
parent 2416b04f5e
commit a78ee43852

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