roadworker 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af3665677e4511d16efbe94f88b4be369f6e5cde
4
- data.tar.gz: b61a6cf8b695aa77a9334ccb3353077f860eb3fb
3
+ metadata.gz: 07906e386dc67f026a0254434e4ed1886d7e17fa
4
+ data.tar.gz: 79b3f49f6310a454308cd7e404c0765b2b874ff2
5
5
  SHA512:
6
- metadata.gz: 1a214364df43143a33b4977c2f79bd348b87ea9e1f5b9198f771304ba307d2d181c1bcf390059014e889d11f6bca17ea52c69c437fa32a139abd3d29c6128642
7
- data.tar.gz: 87707077040830d1627d45611d2b3cad50a168ce094353ab1ec9354783581c3b387ec3330d11df44f74d049659212693e59dc7083c6941fa6197921346efa078
6
+ metadata.gz: d7015d50b5d4bec4b90af58ed0df164dba4c891fa3758840e89fe094c81216a2f9ca23e161773911a475b52ff08cae5b6cb0a281fba1f38edb987ff66273cb11
7
+ data.tar.gz: 796388785e2fc76779aaa68c9bbed2703555cb1a93251fd33e2010866be6f3023a3027ac52d799d69e390df8f5e3172a5a2b6cf17db06a4b2a00a2178a9b848e
@@ -80,7 +80,7 @@ module Roadworker
80
80
 
81
81
  is_valid = rrs.any? {|record|
82
82
  expected_value = (record.resource_records || []).map {|i| i[:value].strip }.sort
83
- expected_ttl = record.dns_name ? 60 : record.ttl
83
+ expected_ttl = fetch_dns_name(record.dns_name) ? 60 : record.ttl
84
84
 
85
85
  actual_value = response.answer.map {|i| (%w(TXT SPF).include?(type) ? i.txt : i.value).strip }.sort
86
86
  actual_ttls = response.answer.map {|i| i.ttl }
@@ -95,7 +95,7 @@ module Roadworker
95
95
  actual_value = actual_value.map {|i| i.strip }
96
96
  end
97
97
 
98
- expected_message = record.resource_records ? expected_value.map {|i| "#{i}(#{expected_ttl})" }.join(',') : "#{record.dns_name}(#{expected_ttl})"
98
+ expected_message = record.resource_records ? expected_value.map {|i| "#{i}(#{expected_ttl})" }.join(',') : "#{fetch_dns_name(record.dns_name)}(#{expected_ttl})"
99
99
  actual_message = actual_value.zip(actual_ttls).map {|v, t| "#{v}(#{t})" }.join(',')
100
100
  logmsg_expected = "expected=#{expected_message}"
101
101
  logmsg_actual = "actual=#{actual_message}"
@@ -103,9 +103,9 @@ module Roadworker
103
103
 
104
104
  is_same = false
105
105
 
106
- if record.dns_name
106
+ if fetch_dns_name(record.dns_name)
107
107
  # A(Alias)
108
- case record.dns_name.sub(/\.\Z/, '')
108
+ case fetch_dns_name(record.dns_name).sub(/\.\Z/, '')
109
109
  when /\.elb\.amazonaws\.com/i
110
110
  is_same = response.answer.all? {|a|
111
111
  response_query_ptr = query(a.value, 'PTR', error_messages)
@@ -128,7 +128,7 @@ module Roadworker
128
128
  log(:debug, 'Retry Check', :white, "#{name} #{type}")
129
129
  end
130
130
 
131
- dns_name_a = query(record.dns_name, 'A', error_messages)
131
+ dns_name_a = query(fetch_dns_name(record.dns_name), 'A', error_messages)
132
132
  s3_website_endpoint_ips = dns_name_a.answer.map {|i| i.value }
133
133
 
134
134
  !s3_website_endpoint_ips.empty? && s3_website_endpoint_ips.any? {|ip|
@@ -146,13 +146,13 @@ module Roadworker
146
146
  end
147
147
  }
148
148
  else
149
- if (alias_target_a_record = a_records[record.dns_name])
149
+ if (alias_target_a_record = a_records[fetch_dns_name(record.dns_name)])
150
150
  expected_message = alias_target_a_record.map {|values, ttl| values.map {|i| "#{i}(#{ttl})" }.join(',') }.uniq.join (' or ')
151
151
  logmsg_expected = "expected=#{expected_message}"
152
152
  expected_ttl = alias_target_a_record.map {|values, ttl| ttl }.max
153
153
  is_same = alias_target_a_record.any? {|values, ttl| values == actual_value }
154
154
  else
155
- warning_messages << "#{name} #{type}: Cannot check `#{record.dns_name}`"
155
+ warning_messages << "#{name} #{type}: Cannot check `#{fetch_dns_name(record.dns_name)}`"
156
156
  is_same = true
157
157
  end
158
158
  end
@@ -299,6 +299,13 @@ module Roadworker
299
299
  print 'F'.intense_red unless @options.debug
300
300
  end
301
301
 
302
+ def fetch_dns_name(dns_name)
303
+ if dns_name
304
+ dns_name.first
305
+ else
306
+ nil
307
+ end
308
+ end
302
309
  end # Tester
303
310
  end # DSL
304
311
  end # Roadworker
@@ -1,5 +1,5 @@
1
1
  module Roadworker
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
4
4
 
5
5
  Version = Roadworker::VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadworker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-26 00:00:00.000000000 Z
11
+ date: 2014-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -184,4 +184,3 @@ signing_key:
184
184
  specification_version: 4
185
185
  summary: Roadworker is a tool to manage Route53.
186
186
  test_files: []
187
- has_rdoc: