Example #1
0
def _partitions(file_servers, report_storages):
    partitions = []
    for fs in file_servers:
        if os.path.exists(fs['filesPrefix']):
            partitions.append({
                'path': fs['filesPrefix'],
                'diskusage': fs['percentfull'],
                'devid': getdeviceid(fs['filesPrefix']),
            })
    for rs in report_storages:
        if os.path.exists(rs['dirPath']):
            partitions.append({
                'path':
                rs['dirPath'],
                'diskusage':
                rs.get('percentfull', percent_full(rs['dirPath'])),
                'devid':
                getdeviceid(rs['dirPath']),
            })
    return partitions
Example #2
0
def _partitions(file_servers,report_storages):
    partitions = []
    for fs in file_servers:
        if os.path.exists(fs['filesPrefix']):
            partitions.append(
                {
                    'path':fs['filesPrefix'],
                    'diskusage':fs['percentfull'],
                    'devid':getdeviceid(fs['filesPrefix']),
                }
            )
    for rs in report_storages:
        if os.path.exists(rs['dirPath']):
            partitions.append(
                {
                    'path':rs['dirPath'],
                    'diskusage':rs.get('percentfull',percent_full(rs['dirPath'])),
                    'devid':getdeviceid(rs['dirPath']),
                }
            )
    return partitions
Example #3
0
def _partitions(file_servers, report_storages):
    '''Returns list of partitions'''
    partitions = []
    for fileserver in file_servers:
        if os.path.exists(fileserver['filesPrefix']):
            partitions.append(
                {
                    'path': fileserver['filesPrefix'],
                    'diskusage': fileserver['percentfull'],
                    'devid': getdeviceid(fileserver['filesPrefix']),
                }
            )
    for reportstorage in report_storages:
        if os.path.exists(reportstorage['dirPath']):
            partitions.append(
                {
                    'path': reportstorage['dirPath'],
                    'diskusage': reportstorage.get('percentfull', percent_full(reportstorage['dirPath'])),
                    'devid': getdeviceid(reportstorage['dirPath']),
                }
            )
    return partitions
Example #4
0
def _partitions(file_servers, report_storages):
    '''Returns list of partitions'''
    partitions = []
    for fileserver in file_servers:
        if os.path.exists(fileserver['filesPrefix']):
            partitions.append(
                {
                    'path':fileserver['filesPrefix'],
                    'diskusage':fileserver['percentfull'],
                    'devid':getdeviceid(fileserver['filesPrefix']),
                }
            )
    for reportstorage in report_storages:
        if os.path.exists(reportstorage['dirPath']):
            partitions.append(
                {
                    'path':reportstorage['dirPath'],
                    'diskusage':reportstorage.get('percentfull',percent_full(reportstorage['dirPath'])),
                    'devid':getdeviceid(reportstorage['dirPath']),
                }
            )
    return partitions
Example #5
0
def _partitions(file_servers, report_storages):
    """Returns list of partitions"""
    partitions = []
    for fileserver in file_servers:
        if os.path.exists(fileserver["filesPrefix"]):
            partitions.append({
                "path": fileserver["filesPrefix"],
                "diskusage": fileserver["percentfull"],
                "devid": getdeviceid(fileserver["filesPrefix"]),
            })
    for reportstorage in report_storages:
        if os.path.exists(reportstorage["dirPath"]):
            partitions.append({
                "path":
                reportstorage["dirPath"],
                "diskusage":
                reportstorage.get("percentfull",
                                  percent_full(reportstorage["dirPath"])),
                "devid":
                getdeviceid(reportstorage["dirPath"]),
            })
    return partitions