'Get extra specs from volume type.'

def _get_extra_specs(self, ctxt, type_id):

    specs = {}
    specs['affinity'] = ''
    specs['alloctype'] = ''
    specs['pool'] = self.configuration.ise_storage_pool
    specs['raid'] = self.configuration.ise_raid
    if (type_id is not None):
        volume_type = volume_types.get_volume_type(ctxt, type_id)
        extra_specs = volume_type.get('extra_specs')
        for (key, value) in extra_specs.items():
            subkey = ''
            if (':' in key):
                fields = key.split(':')
                key = fields[0]
                subkey = fields[1]
            if (key.upper() == 'Feature'.upper()):
                if (subkey.upper() == 'Raid'.upper()):
                    specs['raid'] = value
                elif (subkey.upper() == 'Pool'.upper()):
                    specs['pool'] = value
            elif (key.upper() == 'Affinity'.upper()):
                if self.configuration.ise_affinity:
                    if (subkey.upper() == 'Type'.upper()):
                        specs['affinity'] = value
            elif (key.upper() == 'Alloc'.upper()):
                if self.configuration.san_thin_provision:
                    if (subkey.upper() == 'Type'.upper()):
                        specs['alloctype'] = value
    return specs
