def filesystemItemExists(item):
    if 'path' in item:
        filepath = item['path']
        munkicommon.display_debug1('Checking existence of %s...', filepath)
        if os.path.lexists(filepath):
            munkicommon.display_debug2('\tExists.')
            if 'md5checksum' in item:
                storedchecksum = item['md5checksum']
                ondiskchecksum = munkicommon.getmd5hash(filepath)
                munkicommon.display_debug2('Comparing checksums...')
                if storedchecksum == ondiskchecksum:
                    munkicommon.display_debug2('Checksums match.')
                    return 1
                else:
                    munkicommon.display_debug2(
                        'Checksums differ: expected %s, got %s',
                        storedchecksum, ondiskchecksum)
                    return -1
            else:
                return 1
        else:
            munkicommon.display_debug2('\tDoes not exist.')
            return 0
    else:
        raise munkicommon.Error('No path specified for filesystem item.')
Checks to see if a filesystem item exists.
dataset/ETHPy150Open munki/munki/code/client/munkilib/updatecheck.py/filesystemItemExists