def _parse_block_device_mapping(bdm):
 ebs = bdm.pop('ebs', None)
 if ebs:
  ec2_id = ebs.pop('snapshot_id', None)
  if ec2_id:
   if ec2_id.startswith('snap-'):
    bdm['snapshot_id'] = ec2utils.ec2_snap_id_to_uuid(ec2_id)
   elif ec2_id.startswith('vol-'):
    bdm['volume_id'] = ec2utils.ec2_vol_id_to_uuid(ec2_id)
   ebs.setdefault('delete_on_termination', True)
  bdm.update(ebs)
 return bdm

def _parse_block_device_mapping ( bdm ) : ebs = bdm . pop ( 'ebs' , None ) if ebs : ec2_id = ebs . pop ( 'snapshot_id' , None ) if ec2_id : if ec2_id . startswith ( 'snap-' ) : bdm [ 'snapshot_id' ] = ec2utils . ec2_snap_id_to_uuid ( ec2_id ) elif ec2_id . startswith ( 'vol-' ) : bdm [ 'volume_id' ] = ec2utils . ec2_vol_id_to_uuid ( ec2_id ) ebs . setdefault ( 'delete_on_termination' , True ) bdm . update ( ebs ) return bdm
parse blockdevicemappingitemtype into flat hash blockdevicedmapping .