'Find a secret.
usage_type: one of \'iscsi\', \'ceph\', \'rbd\' or \'volume\'
usage_id: name of resource in secret'

def find_secret(self, usage_type, usage_id):

    if (usage_type == 'iscsi'):
        usage_type_const = libvirt.VIR_SECRET_USAGE_TYPE_ISCSI
    elif (usage_type in ('rbd', 'ceph')):
        usage_type_const = libvirt.VIR_SECRET_USAGE_TYPE_CEPH
    elif (usage_type == 'volume'):
        usage_type_const = libvirt.VIR_SECRET_USAGE_TYPE_VOLUME
    else:
        msg = _('Invalid    usage_type:    %s')
        raise exception.InternalError((msg % usage_type))
    try:
        conn = self.get_connection()
        return conn.secretLookupByUsage(usage_type_const, usage_id)
    except libvirt.libvirtError as e:
        if (e.get_error_code() == libvirt.VIR_ERR_NO_SECRET):
            return None
