def get_file_output(host, path):
    """ Get contents of a file from target at location defined by argument
        'path' and return as string """

    file = None

    with host.sudo():
        file = host.file(path)
    if not file or not file.exists:
        raise Exception("Unable to find file at path '{path}'"
                        .format(path=path))
    return file.content_string.strip()