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

Error: Comparison of: String < Integer, is not possible #684

Closed
erikanderson opened this issue Sep 17, 2015 · 1 comment
Closed

Error: Comparison of: String < Integer, is not possible #684

erikanderson opened this issue Sep 17, 2015 · 1 comment

Comments

@erikanderson
Copy link
Contributor

We are getting ready to upgrade from puppet 3.8 to 4.2 so we have set stringify_facts = false. Once we did that an error popped up from this module. The full error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Comparison of: String < Integer, is not possible. Caused by 'A String is not comparable to a non String'. at /modules/nginx/manifests/resource/location.pp:238:17
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

and the section in question:

  $priority             = 500
...
  validate_array($rewrite_rules)
  if ($priority < 401) or ($priority > 899) {
    fail('$priority must be in the range 401-899.')
  }

To force puppet to see the $priority as an integer by adding zero to it:
(https://docs.puppetlabs.com/puppet/latest/reference/lang_data_number.html#converting-strings-to-numbers)

  validate_array($rewrite_rules)
  if (($priority + 0) < 401) or (($priority + 0) > 899) {
    fail('$priority must be in the range 401-899.')
  }
@erikanderson
Copy link
Contributor Author

Created PR #689

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

No branches or pull requests

1 participant