Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collectd::plugin::ceph - Add additional data types #781

Merged
merged 1 commit into from Apr 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions manifests/plugin/ceph.pp
Expand Up @@ -35,11 +35,11 @@
#
class collectd::plugin::ceph (
Array $daemons,
$ensure = 'present',
$longrunavglatency = false,
$convertspecialmetrictypes = true,
$manage_package = undef,
$package_name = 'collectd-ceph'
Enum['present', 'absent'] $ensure = 'present',
Boolean $longrunavglatency = false,
Boolean $convertspecialmetrictypes = true,
Boolean $manage_package = $collectd::manage_package,
String $package_name = 'collectd-ceph'
) {

include ::collectd
Expand Down
36 changes: 6 additions & 30 deletions spec/classes/collectd_plugin_ceph_spec.rb
Expand Up @@ -7,6 +7,10 @@
facts
end

let :pre_condition do
'include collectd'
end

options = os_specific_options(facts)

context ':ensure => present and :daemons => [ \'ceph-osd.0\, \ceph-osd.1\, \ceph-osd.2\, \test-osd.0\, \ceph-mon.mon01\ ]' do
Expand Down Expand Up @@ -71,28 +75,10 @@
end
end

context ':manage_package => undef/false' do
let :params do
{
daemons: ['ceph-osd.0']
}
end

it 'Will not manage collectd-ceph' do
is_expected.not_to contain_package('collectd-ceph').with(
ensure: 'present',
name: 'collectd-ceph'
)
end
end

context ':manage_package => undef/false on osfamily => RedHat with collectd 5.4 and below' do
let :facts do
facts.merge(collectd_version: '5.4')
end

context ':manage_package => false' do
let :params do
{
manage_package: false,
daemons: ['ceph-osd.0']
}
end
Expand All @@ -104,16 +90,6 @@
)
end
end

context ':ceph is not an array' do
let :params do
{ daemons: 'ceph-osd.0' }
end

it 'Will raise an error about :daemons being a String' do
is_expected.to compile.and_raise_error(%r{String})
end
end
end
end
end