diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-04-15 16:43:27 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 71033786bf4abef4fd486793d6fe186fff87a432 (patch) | |
| tree | f7114c6c417b2bcce7e431b5018a5e0edff8df2d | |
| parent | 54c1cc5dc9f8994378c850474b8fd468300fb0e8 (diff) | |
feature #2276 Single Executable: legacy settings
Puppet's defaults change depending on which command invokes them.
This patch makes sure that we use the maintain the current behavior.
This is a temporary fix until I implement feature #2935.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| -rwxr-xr-x | bin/puppet | 12 | ||||
| -rw-r--r-- | lib/puppet/defaults.rb | 15 |
2 files changed, 20 insertions, 7 deletions
diff --git a/bin/puppet b/bin/puppet index 2f497c5fa..bf4ee3a95 100755 --- a/bin/puppet +++ b/bin/puppet @@ -8,13 +8,13 @@ usage = "Usage: puppet command <space separated arguments>" available = "Available commands are: #{builtins.sort.join(', ')}" require 'puppet/util/command_line' -command_line = Puppet::Util::CommandLine.shift_subcommand_from_argv +$puppet_subcommand_name = Puppet::Util::CommandLine.shift_subcommand_from_argv -if command_name.nil? +if $puppet_subcommand_name.nil? puts usage, available -elsif builtins.include?(command_name) #subcommand - require File.join(appdir, command_name) - Puppet::Application[command_name].run +elsif builtins.include?($puppet_subcommand_name) #subcommand + require File.join(appdir, $puppet_subcommand_name) + Puppet::Application[$puppet_subcommand_name].run else - abort "Error: Unknown command #{command_name}.\n#{usage}\n#{available}" + abort "Error: Unknown command #{$puppet_subcommand_name}.\n#{usage}\n#{available}" end diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index 1f5e0eda4..a9cb48419 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -4,7 +4,20 @@ module Puppet # use basedirs that are in the user's home directory. conf = nil var = nil - name = $0.gsub(/.+#{File::SEPARATOR}/,'').sub(/\.rb$/, '') + + legacy_name = Hash.new{ |h,k| k }.update({ + 'agent' => 'puppetd', + 'cert' => 'puppetca', + 'doc' => 'puppetdoc', + 'filebucket' => 'filebucket', + 'apply' => 'puppet', + 'describe' => 'pi', + 'queue' => 'puppetqd', + 'resource' => 'ralsh', + 'kick' => 'puppetrun', + 'master' => 'puppetmasterd', + }) + name = legacy_name[ $puppet_subcommand_name ] || $0.gsub(/.+#{File::SEPARATOR}/,'').sub(/\.rb$/, '') # Make File.expand_path happy require 'etc' |
