Re: [Puppet Users] is_numeric

2018-08-07 Thread Sebastian Hempel
Hi, > What is the proper way to check if something is numeric? Starting with Puppet 4 you can define parameters of classes and defines with a data type. class myclass( Integer $subsetting ) IMHO this is the prefered way to "check" the type of a variable. You can also specify the range of the

Re: [Puppet Users] is_numeric

2018-08-06 Thread Ben Ford
First off, you should use data types with your class and then you won't have to check--the compile won't even succeed unless you've got the right data type. class foo ( Integer $subsetting, ) { # $subsetting is guaranteed to be numeric here } Second, you can use the is_a