def map_qos_spec(qos_spec, volume):
 if (qos_spec is None):
  return None
 qos_spec = map_dict_to_lower(qos_spec)
 spec = dict(policy_name=get_qos_policy_group_name(volume), max_throughput=None)
 if ('maxiops' in qos_spec):
  spec['max_throughput'] = ('%siops' % qos_spec['maxiops'])
 elif ('maxiopspergib' in qos_spec):
  spec['max_throughput'] = ('%siops' % six.text_type((int(qos_spec['maxiopspergib']) * int(volume['size']))))
 elif ('maxbps' in qos_spec):
  spec['max_throughput'] = ('%sB/s' % qos_spec['maxbps'])
 elif ('maxbpspergib' in qos_spec):
  spec['max_throughput'] = ('%sB/s' % six.text_type((int(qos_spec['maxbpspergib']) * int(volume['size']))))
 return spec

def map_qos_spec ( qos_spec , volume ) : if ( qos_spec is None ) : return None qos_spec = map_dict_to_lower ( qos_spec ) spec = dict ( policy_name = get_qos_policy_group_name ( volume ) , max_throughput = None ) if ( 'maxiops' in qos_spec ) : spec [ 'max_throughput' ] = ( '%siops' % qos_spec [ 'maxiops' ] ) elif ( 'maxiopspergib' in qos_spec ) : spec [ 'max_throughput' ] = ( '%siops' % six . text_type ( ( int ( qos_spec [ 'maxiopspergib' ] ) * int ( volume [ 'size' ] ) ) ) ) elif ( 'maxbps' in qos_spec ) : spec [ 'max_throughput' ] = ( '%sB/s' % qos_spec [ 'maxbps' ] ) elif ( 'maxbpspergib' in qos_spec ) : spec [ 'max_throughput' ] = ( '%sB/s' % six . text_type ( ( int ( qos_spec [ 'maxbpspergib' ] ) * int ( volume [ 'size' ] ) ) ) ) return spec
map cinder qos spec to limit/throughput-value as used in client api .