Puppet Function: complyadm::maybe_to_int

Defined in:
functions/maybe_to_int.pp
Function type:
Puppet Language

Overview

complyadm::maybe_to_int(Any $value)Any

If the value is undef, returns undef, otherwise attempts to cast to an int.

Parameters:

  • value (Any)

Returns:

  • (Any)


2
3
4
5
6
7
# File 'functions/maybe_to_int.pp', line 2

function complyadm::maybe_to_int(Any $value) {
  $int_or_undef = $value ? {
    undef   => undef,
    default => Integer($value),
  }
}