'Checking if class exists on backend. if not - create it.'

def _check_perf_class_on_backend(self, specs):

    perf_class_name = PERF_CLASS_NAME_PREFIX
    if ((specs is None) or (specs == {})):
        return ''
    for (key, value) in specs.items():
        perf_class_name += ((('_' + key) + '_') + value)
    try:
        classes_list = self._call_xiv_xcli('perf_class_list', perf_class=perf_class_name).as_list
        for perf_class in classes_list:
            if ((not (perf_class.get('max_iops', None) == specs.get('iops', '0'))) or (not (perf_class.get('max_bw', None) == specs.get('bw', '0')))):
                raise self.meta['exception'].VolumeBackendAPIException(data=(PERF_CLASS_VALUES_ERROR % {'details': perf_class_name}))
    except errors.XCLIError as e:
        details = self._get_code_and_status_or_message(e)
        msg = (PERF_CLASS_ERROR % {'details': details})
        LOG.error(msg)
        raise self.meta['exception'].VolumeBackendAPIException(data=msg)
    if (not classes_list):
        self._create_qos_class(perf_class_name, specs)
    return perf_class_name
