From ba019abd2978e33264664115b15d1a33c9123031 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 29 Apr 2024 15:49:29 +0200 Subject: [PATCH] puppet_agent::run: properly validate environment parameter previously we assumed that an environment exists in the params hash. And we didn't allow environment names with a single character. This PR fixes both. --- tasks/run.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/run.rb b/tasks/run.rb index 95e55c08..bdf429cf 100755 --- a/tasks/run.rb +++ b/tasks/run.rb @@ -142,7 +142,7 @@ def noop(params) end def environment(params) - (params['environment'].length > 1) ? "--environment=#{params['environment']}" : '' + (params['environment'] && !params['environment'].empty?) ? "--environment=#{params['environment']}" : '' end # Attempts to run the Puppet agent, returning the mtime for the last run report