roadworker 0.4.0 → 0.4.1
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 +4 -4
- data/lib/roadworker/dsl-tester.rb +1 -1
- data/lib/roadworker/route53-exporter.rb +3 -3
- data/lib/roadworker/route53-wrapper.rb +17 -17
- data/lib/roadworker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0d3f642ddf0b9f28e2c6607a14c70f71a05d6e3
|
4
|
+
data.tar.gz: 2068acde30d38e452d3a3840f7d136ce0d5b4ae0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a6142c0e48b09eb6ac983ad9abb34e157c2dcd7c8518d49c44b196f7d909c2cd0340115e36060631507db12e85c02bea8bf1a9e65dcc1d34f3780f801241f79
|
7
|
+
data.tar.gz: 3dc7c2db81defc7750e085c44f2b35db93d24bf4bb8c3315bf46f8ae511fc3f0187a4a688f1cb7cb90e8b9447ff5d7855e0e860dedd805961e340433c09dcb2e
|
@@ -92,7 +92,7 @@ module Roadworker
|
|
92
92
|
actual_value = actual_value.map {|i| i.downcase.sub(/\.\Z/, '') }
|
93
93
|
when 'TXT', 'SPF'
|
94
94
|
# see https://github.com/bluemonk/net-dns/blob/651dc1006d9ee0c167fa515e4b9d2494af415ae9/lib/net/dns/rr/txt.rb#L46
|
95
|
-
expected_value = expected_value.map {|i| i.scan(/"([^"]
|
95
|
+
expected_value = expected_value.map {|i| i.scan(/(?:\\\\|(?:\\"|(?:[^\\"]|[^"])))*"((?:\\\\|(?:\\"|(?:\\"|(?:[^\\"]|[^"]))))*)"/).join(' ').gsub(/\\(.)/) { $1 }.strip }
|
96
96
|
actual_value = actual_value.map {|i| i.strip }
|
97
97
|
end
|
98
98
|
|
@@ -72,9 +72,9 @@ module Roadworker
|
|
72
72
|
def item_to_hash(item, *attrs)
|
73
73
|
h = {}
|
74
74
|
|
75
|
-
attrs.each do |
|
76
|
-
value = item.send(
|
77
|
-
h[
|
75
|
+
attrs.each do |attribute|
|
76
|
+
value = item.send(attribute)
|
77
|
+
h[attribute] = value if value
|
78
78
|
end
|
79
79
|
|
80
80
|
return h
|
@@ -126,20 +126,20 @@ module Roadworker
|
|
126
126
|
else
|
127
127
|
opts = {}
|
128
128
|
|
129
|
-
Route53Wrapper::RRSET_ATTRS.each do |
|
130
|
-
value = expected_record.send(
|
129
|
+
Route53Wrapper::RRSET_ATTRS.each do |attribute|
|
130
|
+
value = expected_record.send(attribute)
|
131
131
|
next unless value
|
132
132
|
|
133
|
-
case
|
133
|
+
case attribute
|
134
134
|
when :dns_name
|
135
|
-
|
135
|
+
attribute = :alias_target
|
136
136
|
value = AWS::Route53.dns_name_to_alias_target(value, @hosted_zone.id, @hosted_zone.name || @options.hosted_zone_name)
|
137
137
|
when :health_check
|
138
|
-
|
138
|
+
attribute = :health_check_id
|
139
139
|
value = @options.health_checks.find_or_create(value)
|
140
140
|
end
|
141
141
|
|
142
|
-
opts[
|
142
|
+
opts[attribute] = value
|
143
143
|
end
|
144
144
|
|
145
145
|
record = @resource_record_sets.create(name, type, opts)
|
@@ -160,16 +160,16 @@ module Roadworker
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def eql?(expected_record)
|
163
|
-
Route53Wrapper::RRSET_ATTRS_WITH_TYPE.all? do |
|
164
|
-
expected = expected_record.send(
|
163
|
+
Route53Wrapper::RRSET_ATTRS_WITH_TYPE.all? do |attribute|
|
164
|
+
expected = expected_record.send(attribute)
|
165
165
|
expected = nil if expected.kind_of?(Array) && expected.empty?
|
166
|
-
actual = self.send(
|
166
|
+
actual = self.send(attribute)
|
167
167
|
actual = nil if actual.kind_of?(Array) && actual.empty?
|
168
168
|
|
169
169
|
if !expected and !actual
|
170
170
|
true
|
171
171
|
elsif expected and actual
|
172
|
-
case
|
172
|
+
case attribute
|
173
173
|
when :dns_name
|
174
174
|
expected = expected.downcase.sub(/\.\Z/, '')
|
175
175
|
actual = actual.downcase.sub(/\.\Z/, '')
|
@@ -191,19 +191,19 @@ module Roadworker
|
|
191
191
|
|
192
192
|
log(:info, 'Update ResourceRecordSet', :green, &log_id_proc)
|
193
193
|
|
194
|
-
Route53Wrapper::RRSET_ATTRS_WITH_TYPE.each do |
|
195
|
-
expected = expected_record.send(
|
194
|
+
Route53Wrapper::RRSET_ATTRS_WITH_TYPE.each do |attribute|
|
195
|
+
expected = expected_record.send(attribute)
|
196
196
|
expected = nil if expected.kind_of?(Array) && expected.empty?
|
197
|
-
actual = self.send(
|
197
|
+
actual = self.send(attribute)
|
198
198
|
actual = nil if actual.kind_of?(Array) && actual.empty?
|
199
199
|
|
200
200
|
if (expected and !actual) or (!expected and actual)
|
201
|
-
log(:info, " set #{
|
202
|
-
self.send(:"#{
|
201
|
+
log(:info, " set #{attribute}=#{expected.inspect}" , :green)
|
202
|
+
self.send(:"#{attribute}=", expected) unless @options.dry_run
|
203
203
|
elsif expected and actual
|
204
204
|
if expected != actual
|
205
|
-
log(:info, " set #{
|
206
|
-
self.send(:"#{
|
205
|
+
log(:info, " set #{attribute}=#{expected.inspect}" , :green)
|
206
|
+
self.send(:"#{attribute}=", expected) unless @options.dry_run
|
207
207
|
end
|
208
208
|
end
|
209
209
|
end
|
data/lib/roadworker/version.rb
CHANGED
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.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|