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 +4 -4
- data/lib/mongo_oplog_backup/backup.rb +7 -2
- data/lib/mongo_oplog_backup/version.rb +1 -1
- data/spec/backup_spec.rb +10 -0
- data/spec/spec_helper.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: ee599dbf9fcfddbf310a1f8196d04e4a9aea58f3
|
4
|
+
data.tar.gz: 60ee3f338862e1a4eecb4aa3c272acb110efc757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/spec/backup_spec.rb
CHANGED
@@ -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
|
data/spec/spec_helper.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bson
|