lib/terraforming/resource/route53_zone.rb in terraforming-0.9.1 vs lib/terraforming/resource/route53_zone.rb in terraforming-0.10.0

- old
+ new

@@ -23,13 +23,13 @@ hosted_zones.inject({}) do |resources, hosted_zone| zone_id = zone_id_of(hosted_zone) vpc = vpc_of(hosted_zone) attributes = { - "comment"=> comment_of(hosted_zone), - "id"=> zone_id, - "name"=> name_of(hosted_zone), + "comment" => comment_of(hosted_zone), + "id" => zone_id, + "name" => name_of(hosted_zone), "name_servers.#" => name_servers_of(hosted_zone).length.to_s, "tags.#" => tags_of(hosted_zone).length.to_s, "vpc_id" => vpc ? vpc.vpc_id : "", "vpc_region" => vpc ? vpc.vpc_region : "", "zone_id" => zone_id, @@ -47,11 +47,11 @@ end private def hosted_zones - @client.list_hosted_zones.hosted_zones.map { |hosted_zone| @client.get_hosted_zone(id: hosted_zone.id) } + @client.list_hosted_zones.map(&:hosted_zones).flatten.map { |hosted_zone| @client.get_hosted_zone(id: hosted_zone.id) } end def tags_of(hosted_zone) @client.list_tags_for_resource(resource_type: "hostedzone", resource_id: zone_id_of(hosted_zone)).resource_tag_set.tags end @@ -80,10 +80,10 @@ def vpc_of(hosted_zone) hosted_zone.vp_cs[0] end def zone_id_of(hosted_zone) - hosted_zone.hosted_zone.id.gsub(/\A\/hostedzone\//, "") + hosted_zone.hosted_zone.id.gsub(%r{\A/hostedzone/}, "") end end end end