我有以下规范文件
require 'spec_helper'
describe 'PLC', :type => 'class' do
let(:hiera_config) { 'spec/fixtures/hiera/hiera.yaml' }
hiera = Hiera.new({ :config => 'spec/fixtures/hiera/hiera.yaml' })
abc = hiera.lookup('PLC::PLC_LINE',nil,nil)
let(:hiera_data) {{
:PLC_LINE => abc
}}
it{ should contain_file('/test/rspec/etc/PLC').with(
'ensure' => 'file',
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'require' => 'File[/test/rspec/etc]') }
it{ should contain_file('/test/rspec/etc/PLC').with_PLC_LINE(abc)}
end下面是我的/hiera/fixtures/plc.yaml
plc : puppetlab当我运行rake spec时,会打印以下消息:
DEBUG: Wed Jul 08 07:11:55 -0400 2015: Hiera YAML backend starting
DEBUG: Wed Jul 08 07:11:55 -0400 2015: Looking up plc::plc_LINE in YAML backend
DEBUG: Wed Jul 08 07:11:55 -0400 2015: Looking for data source plc如何抑制这种输出?
发布于 2016-03-04 16:12:04
只需放入例如spec_helper.rb:
Puppet::Util::Log.level = :warning在客户端,您可以轻松地检查log_level
puppet config print log_level --section agent您可以在例如/etc/puppet/puppet.conf (取决于您信任的路径)中修改它:
[agent]
log_level = infohttps://stackoverflow.com/questions/31291307
复制相似问题