pingable_ipam_plugin 0.0.7 → 0.0.8
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/app/services/ipam/ping_random_db.rb +2 -3
- data/lib/pingable_ipam_plugin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 901121ea8d35be4f887e6b29af60a66c5c893519c9e3deb5e68ce115c947eedf
|
4
|
+
data.tar.gz: 1debb5df608706ec4d0314eeeaede1d68bd007fd9e845f0ebd69e870713f481a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abb24c738c216d047affce4042bf78b7ddbf3fbbf48127c7e8c0258e8be0d18db81918a99cb1736591977b90eddf74d5daa789ff7681626c5706f224ced2783c
|
7
|
+
data.tar.gz: 5d45c0030cd6d41d75094b64d5cfa2084791dd0a49ea330bd30195a7401ecbef33cb3090cc35fbf10adf79706b1e241b367ea240c3978b2cdc0b76faa2777265
|
@@ -9,7 +9,7 @@ module IPAM
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def random_ip(range)
|
12
|
-
IPAddr.new(
|
12
|
+
IPAddr.new(range.sample)
|
13
13
|
end
|
14
14
|
|
15
15
|
def tcp_pingable?(ip)
|
@@ -89,7 +89,7 @@ module IPAM
|
|
89
89
|
range -= subnet.known_ips.to_a
|
90
90
|
|
91
91
|
unless range.empty?
|
92
|
-
logger.info "[IPAM] IP range from #{range.first.to_s} to #{range.last.to_s}"
|
92
|
+
logger.info "[IPAM] IP range from #{range.first.to_s} to #{range.last.to_s}, total: #{range.length}"
|
93
93
|
end
|
94
94
|
|
95
95
|
loop do
|
@@ -98,7 +98,6 @@ module IPAM
|
|
98
98
|
return nil
|
99
99
|
end
|
100
100
|
|
101
|
-
# next random IP from the sequence generated by MAC seed
|
102
101
|
candidate = random_ip(range)
|
103
102
|
iterations += 1
|
104
103
|
break if iterations >= MAX_ITERATIONS
|