mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
changed get_mount_facts to ignore mount types 'none'
This commit is contained in:
parent
e204394c2c
commit
f76043f404
1 changed files with 11 additions and 10 deletions
|
@ -547,16 +547,17 @@ class LinuxHardware(Hardware):
|
|||
for line in mtab.split('\n'):
|
||||
if line.startswith('/'):
|
||||
fields = line.rstrip('\n').split()
|
||||
statvfs_result = os.statvfs(fields[1])
|
||||
self.facts['mounts'].append(
|
||||
{'mount': fields[1],
|
||||
'device':fields[0],
|
||||
'fstype': fields[2],
|
||||
'options': fields[3],
|
||||
# statvfs data
|
||||
'size_total': statvfs_result.f_bsize * statvfs_result.f_blocks,
|
||||
'size_available': statvfs_result.f_bsize * (statvfs_result.f_bavail),
|
||||
})
|
||||
if(fields[2] != 'none'):
|
||||
statvfs_result = os.statvfs(fields[1])
|
||||
self.facts['mounts'].append(
|
||||
{'mount': fields[1],
|
||||
'device':fields[0],
|
||||
'fstype': fields[2],
|
||||
'options': fields[3],
|
||||
# statvfs data
|
||||
'size_total': statvfs_result.f_bsize * statvfs_result.f_blocks,
|
||||
'size_available': statvfs_result.f_bsize * (statvfs_result.f_bavail),
|
||||
})
|
||||
|
||||
def get_device_facts(self):
|
||||
self.facts['devices'] = {}
|
||||
|
|
Loading…
Reference in a new issue