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

Use data types, remove anchors #773

Merged
merged 1 commit into from
Apr 4, 2018

Conversation

juniorsysadmin
Copy link
Member

  • Only allow Boolean for $purge
  • Only allow Boolean for $recurse
  • Only allow Integer for $write_queue_limit_low
  • Only allow Integer for $write_queue_limit_high
  • Don't allow undef for $manage_service
  • Replace anchors with contain
  • Remove some unecessary tests

- Only allow Boolean for $purge
- Only allow Boolean for $recurse
- Only allow Integer for $write_queue_limit_low
- Only allow Integer for $write_queue_limit_high
- Don't allow undef for $manage_service
- Replace anchors with contain
- Remove some unecessary tests
String $package_ensure = $collectd::params::package_ensure,
Optional[Array] $package_install_options = $collectd::params::package_install_options,
Stdlib::Fqdn $package_keyserver = $collectd::params::package_keyserver,
Variant[String[1],Array[String[1]]] $package_name = $collectd::params::package_name,
Copy link
Member Author

@juniorsysadmin juniorsysadmin Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#269 Appears to still affect recent Debian families

@@ -9,20 +9,13 @@

options = os_specific_options(facts)
context 'with all defaults' do
it { is_expected.to contain_class('collectd') }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove those two?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When inside init.pp we know that a class called collectd will always be there. I just didn't see any value to the test.
Same with params.

it { is_expected.to contain_file('collectd.conf').without_content }
it { is_expected.to contain_file('collectd.d').with_ensure('directory') }
it { is_expected.to contain_file_line('include_conf_d').with_ensure('absent') }
it { is_expected.to contain_file_line('include_conf_d_dot_conf').with_ensure('present') }
it { is_expected.to contain_package(options[:package]).with_ensure('present') }
it { is_expected.to contain_package(options[:package]).with_install_options(nil) }
it { is_expected.to contain_class('collectd::install').that_comes_before('Class[collectd::config]') }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those checks should still be valid, since we use ->?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid, but again I don't think it is useful, as we don't have any conditional logic which will result in the order of classes changing.

@bastelfreak bastelfreak merged commit 88de8e9 into voxpupuli:master Apr 4, 2018
@juniorsysadmin juniorsysadmin deleted the datatypes-init branch April 4, 2018 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants