Giuseppe Lavagetto has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/365571 )

Change subject: sysctl::conffile: validate priority as numeric
......................................................................

sysctl::conffile: validate priority as numeric

Change-Id: I4ecfae0eecc86a85f9f1991fffeb4e1c433405ea
---
M modules/sysctl/manifests/conffile.pp
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/71/365571/1

diff --git a/modules/sysctl/manifests/conffile.pp 
b/modules/sysctl/manifests/conffile.pp
index 1e80d13..815c11c 100644
--- a/modules/sysctl/manifests/conffile.pp
+++ b/modules/sysctl/manifests/conffile.pp
@@ -37,10 +37,8 @@
     $priority = 70
 ) {
     include ::sysctl
-
-    if $priority !~ /^\d?\d$/ {
-        fail("'priority' must be an integer between 0 - 99 (got: 
${priority}).")
-    }
+    # TODO/puppet4 Make this a type check
+    validate_numeric($priority, 99, 0)
 
     $basename = regsubst($title, '\W', '-', 'G')
     $filename = sprintf('/etc/sysctl.d/%02d-%s.conf', $priority, $basename)

-- 
To view, visit https://gerrit.wikimedia.org/r/365571
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ecfae0eecc86a85f9f1991fffeb4e1c433405ea
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to