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

Change npm_package_name from "undef" to "false" for better comparison. #195

Merged
merged 1 commit into from
Jan 11, 2016
Merged

Change npm_package_name from "undef" to "false" for better comparison. #195

merged 1 commit into from
Jan 11, 2016

Conversation

x3dfxjunkie
Copy link

Fixes #160

Before:

# puppet apply -v  -e 'class { "nodejs": npm_package_name => undef,} package { "npm": ensure => "2.14.14", provider => "npm",}'
Info: Loading facts
Info: Loading facts
Error: Duplicate declaration: Package[npm] is already declared in file /etc/puppet/modules/nodejs/manifests/install.pp:52; cannot redeclare at line 1 on node ***
Error: Duplicate declaration: Package[npm] is already declared in file /etc/puppet/modules/nodejs/manifests/install.pp:52; cannot redeclare at line 1 on node ***

After:

# puppet apply -v  -e 'class { "nodejs": npm_package_name => false,} package { "npm": ensure => "2.14.14", provider => "npm",}'
Info: Loading facts
Info: Loading facts
Notice: Compiled catalog for *** in environment production in 0.31 seconds
Info: Applying configuration version '1452278934'
Notice: /Stage[main]/Main/Package[npm]/ensure: ensure changed '1.4.29' to '2.14.14'
Notice: Finished catalog run in 4.97 seconds

@igalic
Copy link
Contributor

igalic commented Jan 10, 2016

mmhm. this makes sense.
@x3dfxjunkie would you mind doing a proper rebase (rather than that upstream merge)


n.b.: this would've been easier (or rather: less confusing) if you had used the github flow work flow.
see also voxpupuli/puppet-jira#99 (comment) for a step by step how to

@juniorsysadmin
Copy link
Member

Hmmm. I'm a bit uncomfortable mixing strings and booleans in the same variable. Also, given undef evaluates to false, and therefore we don't manage the package, why are we getting duplicate declarations?

@x3dfxjunkie
Copy link
Author

At least with puppet 3.x, undef isn't the same as false. That may be more of a bug with puppet, but not sure. I could change it to a proper string (like blank or none), but that seems less intuitive.

@x3dfxjunkie
Copy link
Author

Rebased the merge out, sorry for that.

igalic added a commit that referenced this pull request Jan 11, 2016
Change npm_package_name from "undef" to "false" for better comparison.
@igalic igalic merged commit db30094 into voxpupuli:master Jan 11, 2016
@igalic
Copy link
Contributor

igalic commented Jan 11, 2016

thank you @x3dfxjunkie!

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.

4 participants