Faidon Liambotis has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/365569 )

Change subject: motd::script: use validate_numeric for priority
......................................................................


motd::script: use validate_numeric for priority

This also should avoid failures with the future parser, and is also
marginally more correct than what we had now.

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

Approvals:
  Faidon Liambotis: Looks good to me, approved
  jenkins-bot: Verified
  Volans: Looks good to me, but someone else must approve



diff --git a/modules/motd/manifests/script.pp b/modules/motd/manifests/script.pp
index a352e09..fdb98fc 100644
--- a/modules/motd/manifests/script.pp
+++ b/modules/motd/manifests/script.pp
@@ -7,7 +7,7 @@
 # [*priority*]
 #   If you need this script to load before or after other scripts, you
 #   can make it do so by manipulating this value. In most cases, the
-#   default value of 50 should be fine.
+#   default value of 50 should be fine. Value should be between 0 and 99
 #
 # [*content*]
 #   If defined, will be used as the content of the motd script.
@@ -33,8 +33,9 @@
 ) {
     include ::motd
 
+    # TODO/puppet4 - make all of these checks parameter type definitions 
instead
     validate_ensure($ensure)
-    validate_re($priority, '^\d?\d$', '"priority" must be between 0 - 99')
+    validate_numeric($priority, 99, 0)
     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/365569
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib36acb64337f673f20831b5e332bad578d7298d3
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Volans <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to