From a14262bee036e58811f4d720023d742ace975b57 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 17 Jan 2023 16:59:08 +0000 Subject: [PATCH] (CONT-493) PPA validation adjustment Prior to this commit, one of our updates (https://github.com/puppetlabs/puppetlabs-apt/pull/1052) implemented a regex validation for ppa packages that were to be installed. However, this validation did not account for resource names that were dotted. This commit aims to fix this bug in our validation process so that it works as intended. --- manifests/ppa.pp | 2 +- spec/defines/ppa_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 4e5e775181..2a5b4a868d 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -40,7 +40,7 @@ } # 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}") } diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index b8e734d09f..00424dccb7 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -78,7 +78,7 @@ def ppa_exec_params(user, repo, distro = 'trusty', environment = []) [ 'ppa:foo!/bar', 'ppa:foo/bar!', - 'ppa:foo1.0/bar', + 'ppa:foo1,0/bar', 'ppa:foo/bar/foobar', '|| ls -la ||', '|| touch /tmp/foo.txt ||',