nat-monitor 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nat-monitor.rb +14 -3
- data/lib/nat-monitor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96266f7df21b17e73bb5e3098be0de032f0080b5
|
4
|
+
data.tar.gz: a2f089c9f8016888d84074e22e46d38c1f860aab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bb34f688bcec87cc4796b7c613296e7c963218c8d5146ebcb2424a6020453c3e61919170422533f53a585a587d1c783ac6ace1cb081cf3e2086eba6ef9e9f09
|
7
|
+
data.tar.gz: 413a9df75687757fd64e2d835b73a6804c430b8d3138d5371610a78c702cd5c794694cffa1596477609df6668c41b2d02e29afdcec807b82ddffe1a030a90452
|
data/lib/nat-monitor.rb
CHANGED
@@ -51,10 +51,21 @@ module EtTools
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def heartbeat
|
54
|
-
|
54
|
+
if am_i_master?
|
55
|
+
output "Looks like I'm the master"
|
56
|
+
return
|
57
|
+
end
|
55
58
|
un = unreachable_nodes
|
56
|
-
return if
|
57
|
-
|
59
|
+
return if un.empty?
|
60
|
+
if un.count == other_nodes.keys.count # return if I'm unreachable...
|
61
|
+
output "No nodes are reachable. Seems I'm the unreachable one."
|
62
|
+
return
|
63
|
+
end
|
64
|
+
cm = current_master
|
65
|
+
unless un.include?(cm) # ...unless master is unreachable
|
66
|
+
output "current master (#{cm}) is still reachable"
|
67
|
+
return
|
68
|
+
end
|
58
69
|
steal_route
|
59
70
|
end
|
60
71
|
|
data/lib/nat-monitor/version.rb
CHANGED