Skip to content

Commit f04f72e

Browse files
committed
Fix module for puppet 6 support
There are three issues for puppet 6 tests. The first is that the tdagent provider definition is incorrect. We don't need to wrap the definition in a parser function as it should just be loaded. The second is that we need to include the fluentd when testing the plugin resource so that the relationship matcher works correctly. The thrid is that yumrepo has been moved to it's own module and must be defined as a dependency. Fixes: #39
1 parent 4dfc15a commit f04f72e

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

.fixtures.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ fixtures:
66
apt:
77
repo: "git://github.com/puppetlabs/puppetlabs-apt.git"
88
ref: "4.1.0"
9+
yumrepo_core:
10+
repo: "git://github.com/puppetlabs/puppetlabs-yumrepo_core.git"
11+
ref: "1.0.3"
912
symlinks:
1013
fluentd: "#{source_dir}"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This file must be compatible with Ruby 1.8.7 in order to work on EL6.
2-
module Puppet::Parser::Functions
3-
Puppet::Type.type(:package).provide :tdagent, :parent => :gem, :source => :gem do
4-
has_feature :install_options, :versionable
5-
commands :gemcmd => '/opt/td-agent/usr/sbin/td-agent-gem'
6-
end
1+
require 'puppet'
2+
require 'puppet/provider/package'
3+
4+
Puppet::Type.type(:package).provide :tdagent, :parent => :gem, :source => :gem do
5+
has_feature :install_options, :versionable
6+
commands :gemcmd => '/opt/td-agent/usr/sbin/td-agent-gem'
77
end

metadata.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
{
99
"name": "puppetlabs/apt",
1010
"version_requirement": ">= 2.0.0 < 5.0.0"
11+
},
12+
{
13+
"name": "puppetlabs/yumrepo_core",
14+
"version_requirement": ">= 1.0.0 < 2.0.0"
1115
}
1216
],
1317
"issues_url": "https://github.com/soylent/konstantin-fluentd/issues",

spec/defines/plugin_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
RSpec.describe 'fluentd::plugin' do
44
let(:title) { 'fluent-plugin-test' }
5+
let(:pre_condition) { 'include ::fluentd' }
56

67
context 'with redhat', :redhat do
78
it { is_expected.to contain_package(title).with(provider: 'tdagent') }

spec/spec_helper_acceptance.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
hosts.each do |host|
1515
on host, puppet('module', 'install', 'puppetlabs-stdlib')
1616
on host, puppet('module', 'install', 'puppetlabs-apt')
17+
on host, puppet('module', 'install', 'puppetlabs-yumrepo_core')
1718
end
1819
end
1920
end

0 commit comments

Comments
 (0)