Giuseppe Lavagetto has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/377438 )

Change subject: uwsgi: use validate_numeric()
......................................................................


uwsgi: use validate_numeric()

Use validate_numeric() to validate the $port parameter, instead of
trying to validate it with a regular expression. Validating Integers
against REs breaks with the future parser and this is easier to read
anyway.

Change-Id: Id21b3dce62db579a7e8c0df59912eeb39e9fe404
---
M modules/service/manifests/uwsgi.pp
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, approved
  Mobrovac: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/service/manifests/uwsgi.pp 
b/modules/service/manifests/uwsgi.pp
index 25c2210..1ab8148 100644
--- a/modules/service/manifests/uwsgi.pp
+++ b/modules/service/manifests/uwsgi.pp
@@ -111,9 +111,10 @@
     }
 
     # sanity check since a default port cannot be assigned
-    unless $port and $port =~ /^\d+$/ {
-        fail('Service port must be specified and must be a number!')
+    unless $port {
+        fail('Service port must be specified!')
     }
+    validate_numeric($port)
 
     # the local log file name
     $local_logdir = "${service::configuration::log_dir}/${title}"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id21b3dce62db579a7e8c0df59912eeb39e9fe404
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <fai...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to