Do not prepare template when config_template is set

This commit is contained in:
kirby@puppetlabs.com 2018-07-02 14:12:17 -07:00
parent 1b17cceb01
commit 70156ba7f7
2 changed files with 16 additions and 5 deletions

View file

@ -1849,14 +1849,23 @@ EOT
context 'when the configured pool template does not match the prepared template' do
before(:each) do
config[:pools][0]['template'] = new_template
expect(redis).to receive(:hget).with('vmpooler__template__prepared', pool).and_return(current_template)
end
it 'should prepare the template' do
expect(redis).to receive(:hget).with('vmpooler__template__prepared', pool).and_return(current_template)
expect(subject).to receive(:prepare_template).with(config[:pools][0], provider)
subject.evaluate_template(config[:pools][0], provider)
end
context 'if configured_template is provided' do
it 'should not run prepare_template' do
expect(redis).to receive(:hget).with('vmpooler__config__template', pool).and_return(current_template)
expect(subject).to_not receive(:prepare_template)
subject.evaluate_template(config[:pools][0], provider)
end
end
end
context 'when a new template is requested' do