lib/terraforming/resource/ec2.rb in terraforming-0.1.2 vs lib/terraforming/resource/ec2.rb in terraforming-0.1.3
- old
+ new
@@ -68,9 +68,10 @@
def block_device_ids_of(instance)
instance.block_device_mappings.map { |bdm| bdm.ebs.volume_id }
end
def block_devices_of(instance)
+ return [] unless instance.block_device_mappings.length > 0
@client.describe_volumes(volume_ids: block_device_ids_of(instance)).volumes
end
def block_device_mapping_of(instance, volume_id)
instance.block_device_mappings.select { |bdm| bdm.ebs.volume_id == volume_id }[0]