(GH-1057) Regex fix to allow dotted resources
authorLukas Audzevicius <laudzevicius24@hotmail.com>
Tue, 30 Aug 2022 11:56:32 +0000 (12:56 +0100)
committerLukas Audzevicius <laudzevicius24@hotmail.com>
Wed, 31 Aug 2022 14:17:47 +0000 (15:17 +0100)
Prior to this commit, one of our recent module updates introduced a
regex validation step for the resource names in our ppa.pp manifest
which would raise an issue if a valid resource name contained a dot (.).

This commit aims to slightly adjust the regex validation so that it
allows for dotted resource names. This PR should fix issue #1057.

manifests/ppa.pp

index e3c53e8e6d6f5226962da2507e4ce41dc97e0ff3..7ea5c4ca1a08a6dca7d642a7c8c970193bbf99ad 100644 (file)
@@ -40,7 +40,7 @@ define apt::ppa (
   }
 
   # Validate the resource name
-  if $name !~ /^ppa:([a-zA-Z0-9\-_]+)\/([a-zA-z0-9\-_]+)$/ {
+  if $name !~ /^ppa:([a-zA-Z0-9\-_]+)\/([a-zA-z0-9\-_\.]+)$/ {
     fail("Invalid PPA name: ${name}")
   }