Revision 783fb4aa
Added by Marek Hulán over 8 years ago
app/models/host_status/configuration_status.rb | ||
---|---|---|
elsif out_of_sync?
|
||
# out of sync
|
||
return HostStatus::Global::WARN
|
||
elsif no_reports? && host.puppet_proxy
|
||
# no reports and puppet is set
|
||
return HostStatus::Global::WARN
|
||
else
|
||
# active, pending, no changes, no reports
|
||
# active, pending, no changes, no reports (and puppet proxy is not set)
|
||
return HostStatus::Global::OK
|
||
end
|
||
end
|
test/unit/host_status/configuration_status_test.rb | ||
---|---|---|
assert_nil @status.last_report
|
||
end
|
||
|
||
test '#no_reports? results in warning only if puppet reports are expected' do
|
||
@status.stubs(:error? => false)
|
||
@status.stubs(:out_of_sync? => false)
|
||
@status.stubs(:no_reports? => true)
|
||
assert_equal HostStatus::Global::OK, @status.to_global
|
||
|
||
@host.stubs(:puppet_proxy => :something)
|
||
assert_equal HostStatus::Global::WARN, @status.to_global
|
||
end
|
||
|
||
test '#out_of_sync? is false if host reporting is disabled' do
|
||
assert @status.out_of_sync?
|
||
|
Also available in: Unified diff
Fixes #11704 - consider no reports as warning if reports are expected