Revision 85c6f530
Added by Marek Hulán about 8 years ago
app/models/concerns/orchestration/dhcp.rb | ||
---|---|---|
# host.managed? and managed? should always come first so that orchestration doesn't
|
||
# even get tested for such objects
|
||
(host.nil? || host.managed?) && managed? && hostname.present? && ip_available? && mac_available? &&
|
||
!subnet.nil? && subnet.dhcp? && SETTINGS[:unattended] && (!provision? || operatingsystem.present?)
|
||
!subnet.nil? && subnet.dhcp? && subnet.dhcp_boot_mode? && SETTINGS[:unattended] && (!provision? || operatingsystem.present?)
|
||
end
|
||
|
||
def dhcp_record
|
test/unit/orchestration/dhcp_test.rb | ||
---|---|---|
end
|
||
end
|
||
|
||
test 'static boot mode disables dhcp orchestration' do
|
||
if unattended?
|
||
h = FactoryGirl.build(:host, :with_dhcp_orchestration)
|
||
i = FactoryGirl.build(:nic_managed, :ip => '10.0.0.10', :name => 'eth0:0')
|
||
i.host = h
|
||
i.domain = domains(:mydomain)
|
||
i.subnet = FactoryGirl.build(:subnet, :dhcp, :boot_mode => 'Static', :ipam => 'Internal DB')
|
||
refute i.dhcp?
|
||
end
|
||
end
|
||
|
||
test "DHCP record contains jumpstart attributes" do
|
||
h = FactoryGirl.build(:host, :with_dhcp_orchestration,
|
||
:model => FactoryGirl.create(:model, :vendor_class => 'Sun-Fire-V210'))
|
Also available in: Unified diff
Fixes #14113 - run dhcp orchestration only on DHCP subnets