Commit 9dfaa0b5 authored by anonym's avatar anonym
Browse files

Simplify.

parent dfe72510
......@@ -15,17 +15,8 @@ class IPAddr
]
def private?
if self.ipv4?
PrivateIPv4Ranges.each do |ipr|
return true if ipr.include?(self)
end
return false
else
PrivateIPv6Ranges.each do |ipr|
return true if ipr.include?(self)
end
return false
end
private_ranges = self.ipv4? ? PrivateIPv4Ranges : PrivateIPv6Ranges
private_ranges.any? { |range| range.include?(self) }
end
def public?
......
......@@ -46,7 +46,7 @@ class VMNet
def bridge_ip_addr
net_xml = REXML::Document.new(@net.xml_desc)
net_xml.elements['network/ip'].attributes['address']
IPAddr.new(net_xml.elements['network/ip'].attributes['address']).to_s
end
def guest_real_mac
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment