mirror of
https://github.com/OpenNebula/one.git
synced 2025-08-30 13:49:29 +03:00
M #-: Add prefix method to older IPAddr (#1049)
* Revert "M #-: Update Gemfile.locks (#1040)"
This reverts commit 0dcde4b04b
.
* M #-: Add prefix method to older IPAddr
This commit is contained in:
@ -10,7 +10,7 @@ GEM
|
|||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -73,7 +73,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -170,7 +169,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -12,7 +12,7 @@ GEM
|
|||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
awrence (1.2.1)
|
awrence (1.2.1)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -80,7 +80,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -212,7 +211,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -12,7 +12,7 @@ GEM
|
|||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
awrence (1.2.1)
|
awrence (1.2.1)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -80,7 +80,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -212,7 +211,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -10,7 +10,7 @@ GEM
|
|||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -73,7 +73,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -180,7 +179,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -12,7 +12,7 @@ GEM
|
|||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
awrence (1.2.1)
|
awrence (1.2.1)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -80,7 +80,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -212,7 +211,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -12,7 +12,7 @@ GEM
|
|||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
awrence (1.2.1)
|
awrence (1.2.1)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -80,7 +80,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -212,7 +211,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -153,7 +153,3 @@ group :vmware do
|
|||||||
gem 'rbvmomi', '~> 2.2.0'
|
gem 'rbvmomi', '~> 2.2.0'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
group :oneprovision do
|
|
||||||
gem 'ipaddr', '>= 1.2.2'
|
|
||||||
end
|
|
||||||
|
@ -10,7 +10,7 @@ GEM
|
|||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -73,7 +73,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -180,7 +179,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -12,7 +12,7 @@ GEM
|
|||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
awrence (1.2.1)
|
awrence (1.2.1)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -80,7 +80,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -212,7 +211,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -12,7 +12,7 @@ GEM
|
|||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
awrence (1.2.1)
|
awrence (1.2.1)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -80,7 +80,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -212,7 +211,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -12,7 +12,7 @@ GEM
|
|||||||
augeas (0.6.4)
|
augeas (0.6.4)
|
||||||
awrence (1.2.1)
|
awrence (1.2.1)
|
||||||
aws-eventstream (1.1.1)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.436.0)
|
aws-partitions (1.434.0)
|
||||||
aws-sdk-cloudwatch (1.50.0)
|
aws-sdk-cloudwatch (1.50.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
@ -80,7 +80,6 @@ GEM
|
|||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflection (1.0.0)
|
inflection (1.0.0)
|
||||||
ipaddr (1.2.2)
|
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.5.1)
|
json (2.5.1)
|
||||||
@ -212,7 +211,6 @@ DEPENDENCIES
|
|||||||
gnuplot
|
gnuplot
|
||||||
highline (~> 1.7)
|
highline (~> 1.7)
|
||||||
i18n (~> 0.9)
|
i18n (~> 0.9)
|
||||||
ipaddr (>= 1.2.2)
|
|
||||||
ipaddress (~> 0.8.3)
|
ipaddress (~> 0.8.3)
|
||||||
json (>= 2.0)
|
json (>= 2.0)
|
||||||
memcache-client
|
memcache-client
|
||||||
|
@ -103,13 +103,31 @@ IP_TYPE = %w[public_ipv4 global_ipv4]
|
|||||||
|
|
||||||
DEFAULT_PRIVATE_CIDR = "172.16.0.0/12"
|
DEFAULT_PRIVATE_CIDR = "172.16.0.0/12"
|
||||||
|
|
||||||
# Add ^ operator to the IPAddr class
|
|
||||||
class IPAddr
|
class IPAddr
|
||||||
|
|
||||||
|
# Add ^ operator to the IPAddr class
|
||||||
def ^(other)
|
def ^(other)
|
||||||
clone.set(@addr ^ other.to_i)
|
clone.set(@addr ^ other.to_i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Add prefix method, to work with older ipadddr & ruby
|
||||||
|
def prefix
|
||||||
|
case @family
|
||||||
|
when Socket::AF_INET
|
||||||
|
n = IN4MASK ^ @mask_addr
|
||||||
|
i = 32
|
||||||
|
when Socket::AF_INET6
|
||||||
|
n = IN6MASK ^ @mask_addr
|
||||||
|
i = 128
|
||||||
|
else
|
||||||
|
raise AddressFamilyError, "unsupported address family"
|
||||||
|
end
|
||||||
|
while n>0
|
||||||
|
n >>= 1
|
||||||
|
i -= 1
|
||||||
|
end
|
||||||
|
i
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user