Look for Numeric in addition to allowing number-strings
authorTollef Fog Heen <tfheen@err.no>
Sun, 19 Mar 2017 10:43:35 +0000 (11:43 +0100)
committerTollef Fog Heen <tfheen@err.no>
Sun, 19 Mar 2017 10:44:55 +0000 (11:44 +0100)
foo: 587 in yaml gets us a Numeric, and regex matches only matches
strings in newer puppets, so check for that and use sprintf to get us
a string.

modules/exim/manifests/init.pp

index 4ff0fb1..95a24c1 100644 (file)
@@ -136,6 +136,7 @@ class exim {
        }
 
        case getfromhash($site::nodeinfo, 'mail_port') {
+                Numeric: { $mail_port = sprintf("%d", getfromhash($site::nodeinfo, 'mail_port')) }
                /^(\d+)$/: { $mail_port = $1 }
                default: { $mail_port = '25' }
        }