Skip to content

Strict typing in Puppet 4 error #11

@iwalz

Description

@iwalz

Hey,

for Puppet4 I'm getting the following errors via validate_re:

Error: Evaluation Error: Error while evaluating a Function Call, validate_re(): input needs to be a String, not a Fixnum at /etc/puppetlabs/code/environments/production/modules/confd/manifests/init.pp:38:18 on node ip-10-0-0-237.eu-central-1.compute.internal
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, validate_re(): input needs to be a String, not a Fixnum at /etc/puppetlabs/code/environments/production/modules/confd/manifests/resource.pp:31:14  at /etc/puppetlabs/code/modules/profile/manifests/haproxy/haproxy.pp:58 on node ip-10-0-0-237.eu-central-1.compute.internal

It's a massive design break to only allow strings for a function that validates regular expressions, but that's a given fact from Puppet - those are the relevant lines:

init.pp:38

if $interval { validate_re($interval, '^\d+') }

resource.pp:31

  if $mode { validate_re($mode, '^\d+')}

I'm gonna prepare a PR later today to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions