murakumo 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cli/mrkmctl.rb +0 -2
- data/lib/cli/mrkmctl_options.rb +2 -4
- data/lib/cli/murakumo_options.rb +2 -4
- data/lib/misc/murakumo_const.rb +1 -2
- data/lib/srv/murakumo_cloud.rb +0 -3
- metadata +3 -3
data/lib/cli/mrkmctl.rb
CHANGED
data/lib/cli/mrkmctl_options.rb
CHANGED
@@ -9,7 +9,7 @@ def mrkmctl_parse_args
|
|
9
9
|
desc 'displays a list of a record'
|
10
10
|
option :list, '-L', '--list [SEARCH_PHRASE]'
|
11
11
|
|
12
|
-
desc 'adds or updates a record: <hostname>[,<TTL>[,{master|
|
12
|
+
desc 'adds or updates a record: <hostname>[,<TTL>[,{master|backup}]]'
|
13
13
|
option :add, '-A', '--add RECORD', :type => Array, :multiple => true do |value|
|
14
14
|
(1 <= value.length and value.length <= 3) or invalid_argument
|
15
15
|
|
@@ -25,7 +25,7 @@ def mrkmctl_parse_args
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# Priority
|
28
|
-
priority.nil? or /\A(master|
|
28
|
+
priority.nil? or /\A(master|backup)\Z/i =~ priority or invalid_argument
|
29
29
|
end
|
30
30
|
|
31
31
|
desc 'deletes a record'
|
@@ -85,8 +85,6 @@ def mrkmctl_parse_args
|
|
85
85
|
priority = case r[2].to_s
|
86
86
|
when /master/i
|
87
87
|
Murakumo::MASTER
|
88
|
-
when /secondary/i
|
89
|
-
Murakumo::SECONDARY
|
90
88
|
else
|
91
89
|
Murakumo::BACKUP
|
92
90
|
end
|
data/lib/cli/murakumo_options.rb
CHANGED
@@ -47,7 +47,7 @@ def murakumo_parse_args
|
|
47
47
|
end
|
48
48
|
end # :host
|
49
49
|
|
50
|
-
desc 'resource record of an alias: <hostname>[,<TTL>[,{master|
|
50
|
+
desc 'resource record of an alias: <hostname>[,<TTL>[,{master|backup}]]'
|
51
51
|
option :aliases, '-A', '--alias RECORD', :type => Array, :multiple => true do |value|
|
52
52
|
(1 <= value.length and value.length <= 3) or invalid_argument
|
53
53
|
|
@@ -63,7 +63,7 @@ def murakumo_parse_args
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# Priority
|
66
|
-
priority.nil? or /\A(master|
|
66
|
+
priority.nil? or /\A(master|backup)\Z/i =~ priority or invalid_argument
|
67
67
|
end # :aliases
|
68
68
|
|
69
69
|
desc 'ip address of a default resolver'
|
@@ -155,8 +155,6 @@ def murakumo_parse_args
|
|
155
155
|
priority = case r[2].to_s
|
156
156
|
when /master/i
|
157
157
|
Murakumo::MASTER
|
158
|
-
when /secondary/i
|
159
|
-
Murakumo::SECONDARY
|
160
158
|
else
|
161
159
|
Murakumo::BACKUP
|
162
160
|
end
|
data/lib/misc/murakumo_const.rb
CHANGED
data/lib/srv/murakumo_cloud.rb
CHANGED
@@ -382,9 +382,6 @@ module Murakumo
|
|
382
382
|
# 優先度の高いレコードを検索
|
383
383
|
records = shuffle_records(@address_records.select {|i| i['priority'] == MASTER })
|
384
384
|
|
385
|
-
# 次に優先度の高いレコードを検索
|
386
|
-
records.concat(shuffle_records(@address_records.select {|i| i['priority'] == SECONDARY }))
|
387
|
-
|
388
385
|
# レコードが見つからなかった場合はバックアップを選択
|
389
386
|
if records.empty?
|
390
387
|
records = shuffle_records(@address_records.select {|i| i['priority'] == BACKUP })
|
metadata
CHANGED