From: Lukas Audzevicius Date: Tue, 17 Jan 2023 16:59:08 +0000 (+0000) Subject: (CONT-493) PPA validation adjustment X-Git-Tag: v9.0.2~5^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a14262bee036e58811f4d720023d742ace975b57;p=puppet-modules%2Fpuppetlabs-apt.git (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. --- diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 4e5e775..2a5b4a8 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -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}") } diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index b8e734d..00424dc 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -78,7 +78,7 @@ describe 'apt::ppa' do [ 'ppa:foo!/bar', 'ppa:foo/bar!', - 'ppa:foo1.0/bar', + 'ppa:foo1,0/bar', 'ppa:foo/bar/foobar', '|| ls -la ||', '|| touch /tmp/foo.txt ||',