etcdv3 0.11.3 → 0.11.4
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/.travis.yml +1 -0
- data/README.md +6 -0
- data/lib/etcdv3/connection.rb +7 -1
- data/lib/etcdv3/connection_wrapper.rb +7 -1
- data/lib/etcdv3/version.rb +1 -1
- data/spec/etcdv3_spec.rb +1 -1
- data/spec/helpers/shared_examples_for_timeout.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18d76403d57c3e56b75e603931345900a4583b2e94d773b33ca04aa1547e304d
|
4
|
+
data.tar.gz: f1d1f9336f62f18b32fb9d3f055e0043bddb6076022b922b097c0104a7467c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9633a47e982b7777ccda7e5472a663a661e4cf6368689cfbbd8d06a6ca862be47e7c3a75d075919b645611879513d4c88c7f59686b2a0eac15cc160e3ea7520f
|
7
|
+
data.tar.gz: 5a330de810e02ebdec73c279e33b7c2ece0c2aa7c4c877da89a2b285976ce68578ca20b3c51206d9a14c9fccbf18ef6310254010053eaefa59b06b898e1c195a
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -64,6 +64,12 @@ conn.put("test_key", "value").
|
|
64
64
|
|
65
65
|
# Get the key we just wrote.
|
66
66
|
conn.get("test_key")
|
67
|
+
|
68
|
+
# Retrieve everything under the namespace.
|
69
|
+
conn.get("", "\0")
|
70
|
+
|
71
|
+
# Delete everything under the namespace.
|
72
|
+
conn.del("", "\0")
|
67
73
|
```
|
68
74
|
|
69
75
|
_Note: Namespaces are stripped from responses._
|
data/lib/etcdv3/connection.rb
CHANGED
@@ -28,7 +28,13 @@ class Etcdv3
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def call(stub, method, method_args=[])
|
31
|
-
|
31
|
+
*method_args, method_kwargs = method_args if method_args.last.class == Hash
|
32
|
+
|
33
|
+
if method_kwargs.nil?
|
34
|
+
@handlers.fetch(stub).send(method, *method_args)
|
35
|
+
else
|
36
|
+
@handlers.fetch(stub).send(method, *method_args, **method_kwargs)
|
37
|
+
end
|
32
38
|
end
|
33
39
|
|
34
40
|
def refresh_metadata(metadata)
|
@@ -14,7 +14,13 @@ class Etcdv3
|
|
14
14
|
|
15
15
|
private def retry_or_raise(*args)
|
16
16
|
if @allow_reconnect
|
17
|
-
|
17
|
+
*args, kwargs = args if args.last.class == Hash
|
18
|
+
|
19
|
+
if kwargs.nil?
|
20
|
+
handle(*args)
|
21
|
+
else
|
22
|
+
handle(*args, **kwargs)
|
23
|
+
end
|
18
24
|
else
|
19
25
|
raise
|
20
26
|
end
|
data/lib/etcdv3/version.rb
CHANGED
data/spec/etcdv3_spec.rb
CHANGED
@@ -293,7 +293,7 @@ describe Etcdv3 do
|
|
293
293
|
describe '#role_grant_permission' do
|
294
294
|
before { conn.role_add('grant') }
|
295
295
|
after { conn.role_delete('grant') }
|
296
|
-
subject { conn.role_grant_permission('grant', :readwrite, 'a', {range_end: 'Z'}) }
|
296
|
+
subject { conn.role_grant_permission('grant', :readwrite, 'a', **{range_end: 'Z'}) }
|
297
297
|
it { is_expected.to_not be_nil }
|
298
298
|
it_should_behave_like "Etcdv3 instance using a timeout", :role_grant_permission, 'grant', :readwrite, 'a'
|
299
299
|
end
|
@@ -32,13 +32,13 @@ shared_examples_for "Etcdv3 instance using a timeout" do |command, *args|
|
|
32
32
|
it "raises a GRPC::DeadlineExceeded exception when it takes too long" do
|
33
33
|
expect do
|
34
34
|
test_args = args.dup
|
35
|
-
|
36
|
-
conn.public_send(command, *test_args)
|
35
|
+
test_kwargs = {timeout: 0}
|
36
|
+
conn.public_send(command, *test_args, **test_kwargs)
|
37
37
|
end.to raise_exception(GRPC::DeadlineExceeded)
|
38
38
|
end
|
39
39
|
it "accepts a timeout" do
|
40
40
|
test_args = args.dup
|
41
|
-
|
42
|
-
expect{ conn.public_send(command, *test_args) }.to_not raise_exception
|
41
|
+
test_kwargs = {timeout: 10}
|
42
|
+
expect{ conn.public_send(command, *test_args, **test_kwargs) }.to_not raise_exception
|
43
43
|
end
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etcdv3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaun Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|