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

systemd::timer camelcase + nil values #47

Merged
merged 2 commits into from
Jun 16, 2017
Merged

systemd::timer camelcase + nil values #47

merged 2 commits into from
Jun 16, 2017

Conversation

cedef
Copy link
Contributor

@cedef cedef commented May 31, 2017

This is related to @func0der's suggestion about changing the timer.erb template, in #44:

The loop in the template, which only converts the first letter to upper case, needs to be changed to convert underscore_writing to UpperCamelCase.

  • When passing on_calendar => '06:00:00' ERB template would produce
    On_calendar=.. instead of OnCalendar=.
  • Moreover, all undef values were unset because of the var.to_s != 'undef' which
    does not work with Puppet4. The file was full of unassigned directives like
    /^OnBootSec=$/
  • Added spec tests using rspec-puppet-facts to loop over supported OS and spec
    tests for systemd::timer defined type

- When passing `on_calendar => '06:00:00'` ERB template would produce
  On_calendar=.. instead of OnCalendar.
- Moreover, all undef values were unset because of the var.to_s != 'undef' which
  does not work with Puppet4. The file was full of unassigned directives like
  /^OnBootSec=$/
- Added spec tests using rspec-puppet-facts to loop over supported OS and spec
  tests for systemd::timer defined type
@cedef
Copy link
Contributor Author

cedef commented May 31, 2017

I think the timer.rb spec acceptance probably contains a mistake on line 37: file content is tested against the on_boot_sec string instead of OnBootSec.
Although I'm not familiar with acceptance tests... so I might be wrong.

@func0der
Copy link
Contributor

func0der commented Jun 3, 2017

Did you try your scope[variableName].nil? against Puppet 3?
I remember to had it just like that and it did not work. I am not 100% sure though.

Thanks for doing this. I had absolutely no time ^^

@cedef
Copy link
Contributor Author

cedef commented Jun 6, 2017

Based on spec test with PUPPET_VERSION=3.8.7, here is the output: all green light. So it should be ok :)

Regards,

@jordiprats
Copy link
Contributor

I'm loving the way you are converting underscore_writing to UpperCamelCase!

Thanks for your copntribution!

@jordiprats jordiprats merged commit 9c00711 into NTTCom-MS:master Jun 16, 2017
@cedef
Copy link
Contributor Author

cedef commented Jul 3, 2017

I'm loving the way you are converting underscore_writing to UpperCamelCase!

Thank you :)

Thanks for your contribution!

You're welcome !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants