Project

General

Profile

« Previous | Next » 

Revision 2f759414

Added by Dominic Cleal about 10 years ago

fixes #4661 - store hostname with virsh DHCP reservations

View differences:

lib/proxy/dhcp/server/virsh.rb
REXML::XPath.each(doc, "//network/ip[not(@family) or @family='ipv4']/dhcp/host") do |e|
Proxy::DHCP::Record.new(:subnet => subnet,
:ip => e.attributes["ip"],
:mac => e.attributes["mac"])
:mac => e.attributes["mac"],
:hostname => e.attributes["name"])
end
rescue Exception => e
msg = "DHCP virsh provider error: unable to retrive virsh info: #{e}"
......
def addRecord options={}
record = super(options)
virsh_update_dhcp 'add-last', record.mac, record.ip
virsh_update_dhcp 'add-last', record.mac, record.ip, record.name
record
end
def delRecord subnet, record
super(subnet, record)
virsh_update_dhcp 'delete', record.mac, record.ip
virsh_update_dhcp 'delete', record.mac, record.ip, record[:hostname]
end
end
end

Also available in: Unified diff