elasticsearch_s3_backup 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4858fa0862e04b674d69efb32506e2f1736866a
4
- data.tar.gz: 569033bcb7439fadea70e55fd17e40bdae1bcd88
3
+ metadata.gz: fc0cc6ca6194a3876f9d2fa7ab4094a5b9e87a7c
4
+ data.tar.gz: eeb0a6e09c789cc172782690102ae6816380498b
5
5
  SHA512:
6
- metadata.gz: 360fd85e6fcd21746a49504c8b5d4c61c1e7605d135e64643cdfac3f52a424ecb446e329ce442fa8974e581d562eb06950a835741d6db3ab9de6aebdb46bdc7d
7
- data.tar.gz: 85a5d1d8738dde41f5b3763ec13393491190e85dc1779a55d69111434fc68fe2bb0ffa3d5f64e254b645f5244a1d4ec9548225708e00c30465fde8f4ebad8a4d
6
+ metadata.gz: 2fcd218fec0f59e244c4031f524e30f82c073d61c52c28425c696c4628d2ccdb38a8631fa7692edcd895f2ca261c29ae1ab2cce977cb564aa8b9e6415f6278ed
7
+ data.tar.gz: 4511af08a7d651f7d9e9ddaa46f6f671836f1f60e81c77a139a55bdfaefe25d30d958637719180f5f533586f7154c1eaf48667c347085fed88862f8457860f84
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ LineLength:
2
+ Max: 100
3
+
4
+ AbcSize:
5
+ Max: 25
6
+
7
+ MethodLength:
8
+ Max: 30
9
+
10
+ Documentation:
11
+ Enabled: false
12
+
13
+ ClassLength:
14
+ Max: 200
data/bin/console CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "elasticsearch_s3_backup"
3
+ require 'bundler/setup'
4
+ require 'elasticsearch_s3_backup'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
9
  # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
10
+ # require 'pry'
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start
@@ -34,6 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency 'bundler', '~> 1.10'
35
35
  spec.add_development_dependency 'rake', '~> 10.0'
36
36
  spec.add_development_dependency 'rspec'
37
+ spec.add_development_dependency 'rubocop'
37
38
 
38
39
  spec.add_dependency 'activesupport'
39
40
  spec.add_dependency 'unirest'
@@ -41,4 +42,5 @@ Gem::Specification.new do |spec|
41
42
  spec.add_dependency 'pagerduty'
42
43
  spec.add_dependency 'sentry-raven'
43
44
  spec.add_dependency 'elasticsearch'
45
+ spec.add_dependency 'hashie'
44
46
  end
@@ -1,5 +1,5 @@
1
1
  module EverTools
2
2
  class ElasticsearchS3Backup
3
- VERSION = '2.0.3'
3
+ VERSION = '2.0.4'
4
4
  end
5
5
  end
@@ -31,7 +31,7 @@ module EverTools
31
31
  exit
32
32
  end
33
33
 
34
- check_cluster_state!
34
+ wait_for_cluster_state!
35
35
 
36
36
  cleanup_test_indexes
37
37
  insert_test_data
@@ -120,11 +120,15 @@ module EverTools
120
120
  es_api.nodes.info['nodes'][es_api.cluster.state['master_node']]['name'] == node_name
121
121
  end
122
122
 
123
- def check_cluster_state!
124
- cluster_settings = Hashie::Mash.new es_api.cluster.get_settings
125
- if cluster_settings.transient_.cluster_.routing_.allocation_.enable == 'none'
123
+ def wait_for_cluster_state!
124
+ tries = 0
125
+ until (cluster_settings = Hashie::Mash.new es_api.cluster.get_settings) &&
126
+ cluster_settings.transient_.cluster_.routing_.allocation_.enable == 'none'
126
127
  fail 'Shard reallocation is disabled. Snapshot cannot proceed because creating the test ' \
127
- 'index in this state will put the cluster into RED state.'
128
+ 'index in this state will put the cluster into RED state.' if tries >= 5
129
+ logger.warn 'Waiting for shard reallocation to be re-enabled'
130
+ sleep 10
131
+ tries += 1
128
132
  end
129
133
  end
130
134
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch_s3_backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Herot
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-05 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: activesupport
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +150,20 @@ dependencies:
136
150
  - - ">="
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: hashie
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
139
167
  description: ''
140
168
  email:
141
169
  - eric.github@herot.com
@@ -146,6 +174,7 @@ extra_rdoc_files: []
146
174
  files:
147
175
  - ".gitignore"
148
176
  - ".rspec"
177
+ - ".rubocop.yml"
149
178
  - ".travis.yml"
150
179
  - Gemfile
151
180
  - LICENSE.txt