[Buildbot] #3646: wth: unreachable code?

Buildbot trac trac at buildbot.net
Mon Nov 28 21:37:03 UTC 2016


#3646: wth: unreachable code?
-------------------+-------------------
Reporter:  sa2ajj  |      Owner:
    Type:  defect  |     Status:  new
Priority:  major   |  Milestone:  0.9.+
 Version:  0.9.1   |   Keywords:
-------------------+-------------------
 while reviewing Coverity findings, I found this code:
 {{{
     def _convert_deprecated_block_device_mapping(self,
 mapping_definitions):
         new_mapping_definitions = []
         for dev_name, dev_config in iteritems(mapping_definitions):
             new_dev_config = {}
             new_dev_config['DeviceName'] = dev_name
             if dev_config:
                 new_dev_config['Ebs'] = {}
                 new_dev_config['Ebs']['DeleteOnTermination'] =
 dev_config.get(
                     'delete_on_termination', True)
                 new_dev_config['Ebs'][
                     'Encrypted'] = dev_config.get('encrypted')
                 new_dev_config['Ebs']['Iops'] = dev_config.get('iops')
                 new_dev_config['Ebs'][
                     'SnapshotId'] = dev_config.get('snapshot_id')
                 new_dev_config['Ebs']['VolumeSize'] =
 dev_config.get('size')
                 new_dev_config['Ebs'][
                     'VolumeType'] = dev_config.get('volume_type')
                 new_dev_config['Ebs'] = self._remove_none_opts(
                     new_dev_config['Ebs'])
             new_mapping_definitions.append(new_dev_config)
         return new_mapping_definitions
         if not mapping_definitions:
             return None

         for mapping_definition in mapping_definitions:
             ebs = mapping_definition.get('Ebs')
             if ebs:
                 ebs.setdefault('DeleteOnTermination', True)

         return mapping_definitions
 }}}

 what the heck is going on here?

--
Ticket URL: <http://trac.buildbot.net/ticket/3646>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the bugs mailing list