diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index 6cb400b42f..3def6037a1 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -1326,8 +1326,8 @@ class Ec2Inventory(object): instance_vars["ec2_security_group_names"] = ','.join([str(i) for i in group_names]) elif key == 'ec2_block_device_mapping': instance_vars["ec2_block_devices"] = {} - for k, v in value.iteritems(): - instance_vars["ec2_block_devices"][ ( k.split( '/' ) )[ -1 ] ] = v.volume_id + for k, v in value.items(): + instance_vars["ec2_block_devices"][ os.path.basename(k) ] = v.volume_id else: pass # TODO Product codes if someone finds them useful