def _block_device_mapping_handler(self):
    '\n        Handles requests which are generated by code similar to:\n\n            instance.modify_attribute(\'blockDeviceMapping\', {\'/dev/sda1\': True})\n\n        The querystring contains information similar to:\n\n            BlockDeviceMapping.1.Ebs.DeleteOnTermination : [\'true\']\n            BlockDeviceMapping.1.DeviceName : [\'/dev/sda1\']\n\n        For now we only support the "BlockDeviceMapping.1.Ebs.DeleteOnTermination"\n        configuration, but it should be trivial to add anything else.\n        '
    mapping_counter = 1
    mapping_device_name_fmt = 'BlockDeviceMapping.%s.DeviceName'
    mapping_del_on_term_fmt = 'BlockDeviceMapping.%s.Ebs.DeleteOnTermination'
    while True:
        mapping_device_name = (mapping_device_name_fmt % mapping_counter)
        if (mapping_device_name not in self.querystring.keys()):
            break
        mapping_del_on_term = (mapping_del_on_term_fmt % mapping_counter)
        del_on_term_value_str = self.querystring[mapping_del_on_term][0]
        del_on_term_value = (True if ('true' == del_on_term_value_str) else False)
        device_name_value = self.querystring[mapping_device_name][0]
        instance_ids = instance_ids_from_querystring(self.querystring)
        instance_id = instance_ids[0]
        instance = self.ec2_backend.get_instance(instance_id)
        if self.is_not_dryrun('ModifyInstanceAttribute'):
            block_device_type = instance.block_device_mapping[device_name_value]
            block_device_type.delete_on_termination = del_on_term_value
        mapping_counter += 1
    if (mapping_counter > 1):
        return EC2_MODIFY_INSTANCE_ATTRIBUTE
Handles requests which are generated by code similar to:

    instance.modify_attribute('blockDeviceMapping', {'/dev/sda1': True})

The querystring contains information similar to:

    BlockDeviceMapping.1.Ebs.DeleteOnTermination : ['true']
    BlockDeviceMapping.1.DeviceName : ['/dev/sda1']

For now we only support the "BlockDeviceMapping.1.Ebs.DeleteOnTermination"
configuration, but it should be trivial to add anything else.
def _block_device_mapping_handler(self):
    '\n        Handles requests which are generated by code similar to:\n\n            instance.modify_attribute(\'blockDeviceMapping\', {\'/dev/sda1\': True})\n\n        The querystring contains information similar to:\n\n            BlockDeviceMapping.1.Ebs.DeleteOnTermination : [\'true\']\n            BlockDeviceMapping.1.DeviceName : [\'/dev/sda1\']\n\n        For now we only support the "BlockDeviceMapping.1.Ebs.DeleteOnTermination"\n        configuration, but it should be trivial to add anything else.\n        '
    mapping_counter = 1
    mapping_device_name_fmt = 'BlockDeviceMapping.%s.DeviceName'
    mapping_del_on_term_fmt = 'BlockDeviceMapping.%s.Ebs.DeleteOnTermination'
    while True:
        mapping_device_name = (mapping_device_name_fmt % mapping_counter)
        if (mapping_device_name not in self.querystring.keys()):
            break
        mapping_del_on_term = (mapping_del_on_term_fmt % mapping_counter)
        del_on_term_value_str = self.querystring[mapping_del_on_term][0]
        del_on_term_value = (True if ('true' == del_on_term_value_str) else False)
        device_name_value = self.querystring[mapping_device_name][0]
        instance_ids = instance_ids_from_querystring(self.querystring)
        instance_id = instance_ids[0]
        instance = self.ec2_backend.get_instance(instance_id)
        if self.is_not_dryrun('ModifyInstanceAttribute'):
            block_device_type = instance.block_device_mapping[device_name_value]
            block_device_type.delete_on_termination = del_on_term_value
        mapping_counter += 1
    if (mapping_counter > 1):
        return EC2_MODIFY_INSTANCE_ATTRIBUTE