From f5dea19ae9cb47d455243c36652b7904d18e978c Mon Sep 17 00:00:00 2001 From: Lightning Date: Tue, 4 Jun 2024 12:49:44 +0200 Subject: [PATCH] Fix condition syntax --- manifests/fragment.pp | 6 +++--- manifests/init.pp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/fragment.pp b/manifests/fragment.pp index aa85c2cc..e438c5a6 100644 --- a/manifests/fragment.pp +++ b/manifests/fragment.pp @@ -38,10 +38,10 @@ fail("${resource}['${title}']: Can't use 'source' and 'content' at the same time.") } - if $tagging =~ Undef { - $safe_target_name = regsubst($target, '[\\\\/:~\n\s\+\*\(\)@]', '_', 'GM') - } else { + if $tagging { $safe_target_name = $tagging + } else { + $safe_target_name = regsubst($target, '[\\\\/:~\n\s\+\*\(\)@]', '_', 'GM') } concat_fragment { $name: diff --git a/manifests/init.pp b/manifests/init.pp index b1c7ae46..f8d96968 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -126,10 +126,10 @@ } } - if $tagging =~ Undef { - $safe_names = $safe_name - } else { + if $tagging { $safe_names = flatten($safe_name, $tagging) + } else { + $safe_names = $safe_name } if $ensure == 'present' {