Skip to content

Commit

Permalink
puppet_agent::run: properly validate environment parameter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bastelfreak committed Apr 29, 2024
1 parent 15f8033 commit ba019ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba019ab

Please sign in to comment.