Project

General

Profile

« Previous | Next » 

Revision 8838eb42

Added by Ohad Levy over 11 years ago

  • ID 8838eb42a2a292f50126966d3fa768edad3a237a

fixes #1814 - converts sp_* attributes into a BMC interface class

this patch also includes the following

  • added a new interfaces table, and STI objects to represent a NIC, BMC, Managed
    and a bootable interface.
  • refactored DHCP/DNS orchestation code, so they can work on the
    interface objects and on the primary interface information that still
    reside in the hosts table.
  • added basic UI for interface selection

this refactor also helps to simply refactoring the host object into
multiple objects.

this patch also fixes
fixes #1325 - BMC NIC should also create DNS entry
fixes #1813 - allow to support multiple NIC per host

View differences:

app/controllers/subnets_controller.rb
# query our subnet dhcp proxy for an unused IP
def freeip
not_found and return unless (s=params[:subnet_id].to_i) > 0
not_found and return unless (subnet = Subnet.find(s))
if (ip = subnet.unused_ip(params[:host_mac]))
respond_to do |format|
format.html do
render :update do |page|
page['#host_ip'].val(ip)
page['#host_ip'].show('highlight', 5000)
@organization = params[:organization_id].blank? ? nil : Organization.find(params[:organization_id])
@location = params[:location_id].blank? ? nil : Location.find(params[:location_id])
Taxonomy.as_taxonomy @organization, @location do
not_found and return unless (subnet = Subnet.find(s))
if (ip = subnet.unused_ip(params[:host_mac]))
respond_to do |format|
format.html do
render :update do |page|
page['#host_ip'].val(ip)
page['#host_ip'].show('highlight', 5000)
end
end
format.json { render :json => {:ip => ip} }
end
format.json { render :json => {:ip => ip} }
else
# we don't want any failures if we failed to query our proxy
head :status => 200
end
else
# we don't want any failures if we failed to query our proxy
head :status => 200
end
rescue => e
logger.warn "Failed to query #{subnet} for free ip: #{e}"

Also available in: Unified diff