def register_image(self, *args, **kwargs):
        context = self._config.context
        vm_type = context.ami.get("vm_type", "paravirtual")
        if 'manifest' in kwargs:
            ami_metadata = {
                'name': context.ami.name,
                'description': context.ami.description,
                'image_location': kwargs['manifest'],
                'virtualization_type': vm_type
            }
        else:
            # args will be [block_device_map, root_block_device]
            block_device_map, root_block_device = args[:2]
            bdm = self._make_block_device_map(block_device_map, root_block_device)
            ami_metadata = {
                'name': context.ami.name,
                'description': context.ami.description,
                'block_device_map': bdm,
                'root_device_name': root_block_device,
                'kernel_id': context.base_ami.kernel_id,
                'ramdisk_id': context.base_ami.ramdisk_id,
                'architecture': context.base_ami.architecture,
                'virtualization_type': vm_type
            }
            if vm_type == "hvm":
                del ami_metadata['kernel_id']
                del ami_metadata['ramdisk_id']

        if vm_type == 'hvm':
            if context.ami.get("enhanced_networking", False):
                ami_metadata['sriov_net_support'] = 'simple'

        if not self._register_image(**ami_metadata):
            return False
        return True
dataset/ETHPy150Open Netflix/aminator/aminator/plugins/cloud/ec2.py/EC2CloudPlugin.register_image/original