From bf6bd1079750b533e02f8c4435001fb8796598bc Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Fri, 7 Jun 2013 16:55:33 +0200 Subject: [PATCH] changed get_mount_facts to ignore mount types 'none' --- system/setup | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/system/setup b/system/setup index 274fb469ee9..0d48c015be3 100644 --- a/system/setup +++ b/system/setup @@ -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'] = {}