elastomer-cli 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +6 -0
- data/lib/elastomer/cli/cluster.rb +1 -1
- data/lib/elastomer/cli/shard.rb +3 -2
- data/lib/elastomer/cli/version.rb +1 -1
- data/test/shard_test.rb +4 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05a6d24e04fbf47b151bd04a4b05d32ed5a7a0b6
|
4
|
+
data.tar.gz: 08510d4265249bba05e5c11a40982d7a3a71862b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1239543d8aee2e7819461ab3931d547c45ed1dcdece4babaefe81d1105668e4dddef004a550ec7f2f56f31ad9b53b8415f15832887a269577d774a4cad0006e
|
7
|
+
data.tar.gz: b239e43405a661cb19a8e7ed27782eb62d283f838532ec8426124a0eff1779065d33ece36c932d41dd524b431cc06f72485441cba85bb8b7003d18b497ff55dc
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.0
|
data/CHANGELOG.md
CHANGED
@@ -83,7 +83,7 @@ module Elastomer
|
|
83
83
|
else
|
84
84
|
raise Thor::Error, "ERROR: Unknown allocation command: #{command}"
|
85
85
|
end
|
86
|
-
elsif client.version =~ /^1./
|
86
|
+
elsif client.version =~ /^1./ || client.version =~ /^2./
|
87
87
|
setting = "cluster.routing.allocation.enable"
|
88
88
|
value = case command
|
89
89
|
when 'enable'
|
data/lib/elastomer/cli/shard.rb
CHANGED
@@ -173,9 +173,10 @@ module Elastomer
|
|
173
173
|
# ["storage1", "storage2"]
|
174
174
|
#
|
175
175
|
def normalized_node_names
|
176
|
-
|
176
|
+
names = node_names
|
177
|
+
return names if node_names.length == 1
|
177
178
|
|
178
|
-
|
179
|
+
ary = node_names.map {|name| name.split("-")}
|
179
180
|
|
180
181
|
ary.first.length.times do |col|
|
181
182
|
name_part = ary.map {|row| row[col]}
|
data/test/shard_test.rb
CHANGED
@@ -13,9 +13,12 @@ describe Elastomer::CLI::Shard do
|
|
13
13
|
it 'should normalize node names' do
|
14
14
|
names = (1..4).map {|n| "githubsearch4-storage%d-cp1-prd" % n}
|
15
15
|
@shard_stats = Elastomer::CLI::Shard.new
|
16
|
-
@shard_stats.instance_variable_set(:@node_names, names)
|
17
16
|
|
17
|
+
@shard_stats.instance_variable_set(:@node_names, names)
|
18
18
|
@shard_stats.normalized_node_names.must_equal %w[storage1 storage2 storage3 storage4]
|
19
|
+
|
20
|
+
@shard_stats.instance_variable_set(:@node_names, [names.at(2)])
|
21
|
+
@shard_stats.normalized_node_names.must_equal %w[githubsearch4-storage3-cp1-prd]
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastomer-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Rodgers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
192
|
+
rubygems_version: 2.5.1
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: Command line interface for elastomer
|
@@ -210,4 +210,3 @@ test_files:
|
|
210
210
|
- test/shard_test.rb
|
211
211
|
- test/snapshot_test.rb
|
212
212
|
- test/test_helper.rb
|
213
|
-
has_rdoc:
|