Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356483 )

Change subject: motd::script: Don't use validate_re on an integer
......................................................................

motd::script: Don't use validate_re on an integer

Rewrite the validate_re check to use integer friendly functions and
comparisons instead

Change-Id: Iabd27cd00a83f86d380f854c326a678bb8499b23
---
M modules/motd/manifests/script.pp
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/83/356483/1

diff --git a/modules/motd/manifests/script.pp b/modules/motd/manifests/script.pp
index a352e09..9051130 100644
--- a/modules/motd/manifests/script.pp
+++ b/modules/motd/manifests/script.pp
@@ -34,7 +34,9 @@
     include ::motd
 
     validate_ensure($ensure)
-    validate_re($priority, '^\d?\d$', '"priority" must be between 0 - 99')
+    if !is_integer($priority) or $priority < 0 or $priority > 99 {
+        fail('"priority" must be between 0 - 99')
+    }
     if $source == undef and $content == undef  { fail('you must provide either 
"source" or "content"') }
     if $source != undef and $content != undef  { fail('"source" and "content" 
are mutually exclusive') }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabd27cd00a83f86d380f854c326a678bb8499b23
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <akosia...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to