def contains(path, text):
    path = os.path.expanduser(path)

    if not os.path.exists(path):
        return False

    stripped_text = str(text).strip()
    try:
        with salt.utils.filebuffer.BufferedReader(path) as breader:
            for chunk in breader:
                if stripped_text in chunk:
                    return True
        return False
    except (IOError, OSError):
        return False
Test availability zone could be deleted successfully.
dataset/ETHPy150Open saltstack/salt/salt/modules/file.py/contains--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/test_availability_zones.py/AvailabilityZoneTestCases.test_delete_host_availability_zone