summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2010-08-05 11:09:25 -0700
committerMarkus Roberts <Markus@reality.com>2010-08-21 13:07:19 -0700
commit3df0490c9dbc59e27869e09864177536400a5ae3 (patch)
treec1aa03afbf81acefa474828c7e4ef9946a09b515 /lib
parent5d4f2224a0544d550be0f502fd0defda6697b178 (diff)
downloadpuppet-3df0490c9dbc59e27869e09864177536400a5ae3.tar.gz
puppet-3df0490c9dbc59e27869e09864177536400a5ae3.tar.xz
puppet-3df0490c9dbc59e27869e09864177536400a5ae3.zip
[#4298] Puppet apply prints an error if the file to apply doesn't exist
Also warns you it's skipping files if you pass it more than one file to apply. Reviewed-by: Nick Lewis <nick@puppetlabs.com> Signed-off-by: Matt Robinson <matt@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/application/apply.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb
index bb4186dbd..152b75442 100644
--- a/lib/puppet/application/apply.rb
+++ b/lib/puppet/application/apply.rb
@@ -78,7 +78,10 @@ class Puppet::Application::Apply < Puppet::Application
if options[:code] or command_line.args.length == 0
Puppet[:code] = options[:code] || STDIN.read
else
- Puppet[:manifest] = command_line.args.shift
+ manifest = command_line.args.shift
+ raise "Could not find file #{manifest}" unless File.exist?(manifest)
+ Puppet.warning("Only one file can be applied per run. Skipping #{command_line.args.join(', ')}") if command_line.args.size > 0
+ Puppet[:manifest] = manifest
end
# Collect our facts.