'Find the result specified by attribute and value.
If the JSON blob is a list then it will be searched for the attribute
and value combination.  If attribute and value are not specified then
the first item is returned.  If the JSON blob is a dict then it
will be returned so long as the dict matches the attribute and value
combination or attribute is None.
:param blob: The REST call\'s JSON response.  Can be a list or dict.
:param attribute: The attribute we are looking for.  If it is None
the first item in the list, or the dict, is returned.
:param value: The attribute value we are looking for.  If the attribute
is None this value is ignored.
:returns: The JSON content in blob, the dict specified by matching the
attribute and value or None.'

def _get_result(self, blob, attribute, value):

    rsp = None
    content = self._get_json(blob)
    if (content is not None):
        if isinstance(content, list):
            for r in content:
                if ((attribute is None) or (r.get(attribute) == value)):
                    rsp = r
                    break
        elif isinstance(content, dict):
            if ((attribute is None) or (content.get(attribute) == value)):
                rsp = content
        elif (attribute is None):
            rsp = content
    if (rsp is None):
        LOG.debug('Unable    to    find    result    where    %(attr)s    is    %(val)s', {'attr': attribute, 'val': value})
        LOG.debug('Blob    was    %(blob)s', {'blob': blob.text})
    return rsp
