mongo-oplog-backup 0.0.10 → 0.0.11

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: 0c7c7a2d6fe026794174767a87b18f6ceb6e3a23
4
- data.tar.gz: f08e6267096e438fc98c2f35e09984dfede204f9
3
+ metadata.gz: ee599dbf9fcfddbf310a1f8196d04e4a9aea58f3
4
+ data.tar.gz: 60ee3f338862e1a4eecb4aa3c272acb110efc757
5
5
  SHA512:
6
- metadata.gz: 584ccd474c2601256d71c831623e903d80505f549787b78d4cbfa71375af35d630616ff5bad7e0b20af4729dbf2e204cbcef280cf73e72d28e62fe019c995d28
7
- data.tar.gz: 4db03ccb06d66a6295fde3c79a75066a4ded1eb3830cd0416e46b9f7a42c99897a88a0d71035100e61960d1629c0e8291447be0f4e42157413bcdaf1da7bb78a
6
+ metadata.gz: 5ddbe8b87d6ef34fdb5b5d0bda352fd41c4a5b6f11a5588d00c9c53e7325d433d40d3dfd3325ae1f03a1f8290039357a8eebbe0a09572131dc04f0daba7c7f92
7
+ data.tar.gz: 0ad3c9e703de40f772f137c8c7525fb6e049b78d170e3d8ddee2900f7e31f1422e765e4ae8bb94f6e13922fe586fe0f987b4a26ed2820849c654b8e0e480f28e
@@ -106,11 +106,17 @@ module MongoOplogBackup
106
106
  result
107
107
  end
108
108
 
109
+ # Because https://jira.mongodb.org/browse/SERVER-18643
110
+ # Mongo shell warns (in stdout) about self-signed certs, regardless of 'allowInvalidCertificates' option.
111
+ def strip_warnings_which_should_be_in_stderr_anyway data
112
+ data.gsub(/^.*[thread\d.*].* certificate.*$/,'')
113
+ end
114
+
109
115
  def latest_oplog_timestamp
110
116
  script = File.expand_path('../../oplog-last-timestamp.js', File.dirname(__FILE__))
111
117
  result_text = config.mongo('admin', script).standard_output
112
118
  begin
113
- response = JSON.parse(result_text)
119
+ response = JSON.parse(strip_warnings_which_should_be_in_stderr_anyway(result_text))
114
120
  return nil unless response['position']
115
121
  BSON::Timestamp.from_json(response['position'])
116
122
  rescue JSON::ParserError => e
@@ -200,6 +206,5 @@ module MongoOplogBackup
200
206
  nil
201
207
  end
202
208
  end
203
-
204
209
  end
205
210
  end
@@ -1,3 +1,3 @@
1
1
  module MongoOplogBackup
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -58,4 +58,14 @@ describe MongoOplogBackup do
58
58
  timestamps.first.should == first
59
59
  timestamps.last.should == last
60
60
  end
61
+
62
+
63
+ it "should ignore non-critical warnings (eg. about self-signed certs) from mongo shell" do
64
+ data = <<FAUXWARNINGS
65
+ 2016-11-23T09:34:58.721-0500 W NETWORK [thread1] SSL peer certificate validation failed: self signed certificate
66
+ 2016-11-23T09:34:58.721-0500 W NETWORK [thread1] The server certificate does not match the host name datanode3.example.com
67
+ {"position":{"t":1479902357,"i":1}}
68
+ FAUXWARNINGS
69
+ expect { JSON.parse(backup.strip_warnings_which_should_be_in_stderr_anyway(data)) }.to_not raise_error
70
+ end
61
71
  end
@@ -37,7 +37,7 @@ end
37
37
 
38
38
  RSpec.configure do |config|
39
39
  config.expect_with :rspec do |c|
40
- c.syntax = :should
40
+ c.syntax = [:should, :expect]
41
41
  end
42
42
 
43
43
  config.before(:each) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo-oplog-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralf Kistner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-23 00:00:00.000000000 Z
11
+ date: 2016-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bson