plugins/providers/virtualbox/driver/version_6_1.rb in vagrant-unbundled-2.2.7.0 vs plugins/providers/virtualbox/driver/version_6_1.rb in vagrant-unbundled-2.2.8.0
- old
+ new
@@ -8,9 +8,32 @@
def initialize(uuid)
super
@logger = Log4r::Logger.new("vagrant::provider::virtualbox_6_1")
end
+
+ def read_dhcp_servers
+ execute("list", "dhcpservers", retryable: true).split("\n\n").collect do |block|
+ info = {}
+
+ block.split("\n").each do |line|
+ if network = line[/^NetworkName:\s+HostInterfaceNetworking-(.+?)$/, 1]
+ info[:network] = network
+ info[:network_name] = "HostInterfaceNetworking-#{network}"
+ elsif ip = line[/^Dhcpd IP:\s+(.+?)$/, 1]
+ info[:ip] = ip
+ elsif netmask = line[/^NetworkMask:\s+(.+?)$/, 1]
+ info[:netmask] = netmask
+ elsif lower = line[/^LowerIPAddress:\s+(.+?)$/, 1]
+ info[:lower] = lower
+ elsif upper = line[/^UpperIPAddress:\s+(.+?)$/, 1]
+ info[:upper] = upper
+ end
+ end
+
+ info
+ end
+ end
end
end
end
end