summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application/apply.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/application/apply.rb')
-rw-r--r--lib/puppet/application/apply.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb
index d977cf1d0..88385f0a0 100644
--- a/lib/puppet/application/apply.rb
+++ b/lib/puppet/application/apply.rb
@@ -4,7 +4,7 @@ require 'puppet/configurer'
require 'puppet/network/handler'
require 'puppet/network/client'
-Puppet::Application.new(:apply) do
+class Puppet::Application::Apply < Puppet::Application
should_parse_config
@@ -30,17 +30,17 @@ Puppet::Application.new(:apply) do
end
end
- dispatch do
+ def run_command
if options[:catalog]
- :apply
+ apply
elsif Puppet[:parseonly]
- :parseonly
+ parseonly
else
- :main
+ main
end
end
- command(:apply) do
+ def apply
require 'puppet/configurer'
if options[:catalog] == "-"
@@ -64,7 +64,7 @@ Puppet::Application.new(:apply) do
configurer.run :catalog => catalog
end
- command(:parseonly) do
+ def parseonly
# Set our code or file to use.
if options[:code] or Puppet::Util::CommandLine.args.length == 0
Puppet[:code] = options[:code] || STDIN.read
@@ -80,7 +80,7 @@ Puppet::Application.new(:apply) do
exit 0
end
- command(:main) do
+ def main
# Set our code or file to use.
if options[:code] or Puppet::Util::CommandLine.args.length == 0
Puppet[:code] = options[:code] || STDIN.read
@@ -153,7 +153,7 @@ Puppet::Application.new(:apply) do
end
end
- setup do
+ def setup
if Puppet.settings.print_configs?
exit(Puppet.settings.print_configs ? 0 : 1)
end