def validate_qos_spec(qos_spec):
 if (qos_spec is None):
  return
 normalized_qos_keys = [key.lower() for key in QOS_KEYS]
 keylist = []
 for (key, value) in qos_spec.items():
  lower_case_key = key.lower()
  if (lower_case_key not in normalized_qos_keys):
   msg = (_('Unrecognized QOS keyword: "%s"') % key)
   raise exception.Invalid(msg)
  keylist.append(lower_case_key)
 if (len(keylist) > 1):
  msg = _('Only one limit can be set in a QoS spec.')
  raise exception.Invalid(msg)

def validate_qos_spec ( qos_spec ) : if ( qos_spec is None ) : return normalized_qos_keys = [ key . lower ( ) for key in QOS_KEYS ] keylist = [ ] for ( key , value ) in qos_spec . items ( ) : lower_case_key = key . lower ( ) if ( lower_case_key not in normalized_qos_keys ) : msg = ( _ ( 'Unrecognized QOS keyword: "%s"' ) % key ) raise exception . Invalid ( msg ) keylist . append ( lower_case_key ) if ( len ( keylist ) > 1 ) : msg = _ ( 'Only one limit can be set in a QoS spec.' ) raise exception . Invalid ( msg )
check validity of cinder qos spec for our backend .