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.
This commit is contained in:
parent
a875b63703
commit
8b27085c34
1 changed files with 1 additions and 1 deletions
|
@ -388,7 +388,7 @@ class LinuxHardware(Hardware):
|
||||||
|
|
||||||
def get_mount_facts(self):
|
def get_mount_facts(self):
|
||||||
self.facts['mounts'] = []
|
self.facts['mounts'] = []
|
||||||
mtab = get_file_content('/etc/mtab')
|
mtab = get_file_content('/etc/mtab', '')
|
||||||
for line in mtab.split('\n'):
|
for line in mtab.split('\n'):
|
||||||
if line.startswith('/'):
|
if line.startswith('/'):
|
||||||
fields = line.rstrip('\n').split()
|
fields = line.rstrip('\n').split()
|
||||||
|
|
Loading…
Reference in a new issue