lib/capistrano/asg/rolling/ami.rb in capistrano-asg-rolling-0.2.0 vs lib/capistrano/asg/rolling/ami.rb in capistrano-asg-rolling-0.2.1
- old
+ new
@@ -59,15 +59,15 @@
image_snapshots.each(&:delete)
end
def snapshots
@snapshots ||= aws_ec2_image.block_device_mappings.map do |mapping|
- Snapshot.new(mapping.ebs.snapshot_id)
- end
+ Snapshot.new(mapping.ebs.snapshot_id) if mapping.ebs
+ end.compact
end
def tags
- @tags ||= aws_ec2_image.tags.map { |tag| [tag.key, tag.value] }.to_h
+ @tags ||= aws_ec2_image.tags.to_h { |tag| [tag.key, tag.value] }
end
def tag?(key)
tags.key?(key)
end