Commit 8b27085c by Maykel Moya

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.
parent a875b637
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment