def _read_file(path):
    '''
    Reads and returns the contents of a file
    '''
    try:
        with salt.utils.fopen(path, 'rb') as contents:
            # without newlines character. http://stackoverflow.com/questions/12330522/reading-a-file-without-newlines
            lines = contents.read().splitlines()
            try:
                lines.remove('')
            except __HOLE__:
                pass
            return lines
    except Exception:
        return []  # Return empty list for type consistency
dataset/ETHPy150Open saltstack/salt/salt/modules/rh_ip.py/_read_file