'get disk utilization statistics'

def get_diskusage(self):

    devices = []
    for entry in os.listdir(self.devices):
        if (not os.path.isdir(os.path.join(self.devices, entry))):
            continue
        try:
            mounted = check_mount(self.devices, entry)
        except OSError as err:
            devices.append({'device': entry, 'mounted': str(err), 'size': '', 'used': '', 'avail': ''})
            continue
        if mounted:
            path = os.path.join(self.devices, entry)
            disk = os.statvfs(path)
            capacity = (disk.f_bsize * disk.f_blocks)
            available = (disk.f_bsize * disk.f_bavail)
            used = (disk.f_bsize * (disk.f_blocks - disk.f_bavail))
            devices.append({'device': entry, 'mounted': True, 'size': capacity, 'used': used, 'avail': available})
        else:
            devices.append({'device': entry, 'mounted': False, 'size': '', 'used': '', 'avail': ''})
    return devices
