Skip to content

Commit f9e7929

Browse files
committed
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.
1 parent 15f8033 commit f9e7929

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/run.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def noop(params)
142142
end
143143

144144
def environment(params)
145-
(params['environment'].length > 1) ? "--environment=#{params['environment']}" : ''
145+
(params['environment'] && params['environment'].length > 0) ? "--environment=#{params['environment']}" : ''
146146
end
147147

148148
# Attempts to run the Puppet agent, returning the mtime for the last run report

0 commit comments

Comments
 (0)