summaryrefslogtreecommitdiffstats
path: root/lib/puppet.rb
diff options
context:
space:
mode:
authorAndrew Shafer <andrew@reductivelabs.com>2008-06-16 02:05:38 -0600
committerAndrew Shafer <andrew@reductivelabs.com>2008-06-16 02:07:24 -0600
commit422dea05e755f0026c7786b46a7e93624da1ac0a (patch)
tree0eeae0da5329071f5bad1059a2d32b8ad4a8a242 /lib/puppet.rb
parent5273b22b4fda6f9aa7a8366a1dfbae092594d391 (diff)
downloadpuppet-422dea05e755f0026c7786b46a7e93624da1ac0a.tar.gz
puppet-422dea05e755f0026c7786b46a7e93624da1ac0a.tar.xz
puppet-422dea05e755f0026c7786b46a7e93624da1ac0a.zip
issue 1183
Added environment awareness to --configprint Pulled the logic for --configprint --genconfig and --genmanifest out of puppet.rb Put the logic in lib/puppet/util/settings.rb and refactored it a bit Added specs for the behavior Reformated the whole spec file to use nested describe Added the new method to the executables The old behavior should be preserved, except for the env is now used
Diffstat (limited to 'lib/puppet.rb')
-rw-r--r--lib/puppet.rb43
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/puppet.rb b/lib/puppet.rb
index 66a52f9e3..83e5da68f 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -117,49 +117,6 @@ module Puppet
# Load all of the configuration parameters.
require 'puppet/defaults'
- # Prints the contents of a config file with the available config elements, or it
- # prints a single value of a config element.
- def self.genconfig
- if Puppet[:configprint] != ""
- val = Puppet[:configprint]
- if val == "all"
- hash = {}
- Puppet.settings.each do |name, obj|
- val = obj.value
- case val
- when true, false, "": val = val.inspect
- end
- hash[name] = val
- end
- hash.sort { |a,b| a[0].to_s <=> b[0].to_s }.each do |name, val|
- puts "%s = %s" % [name, val]
- end
- elsif val =~ /,/
- val.split(/\s*,\s*/).sort.each do |v|
- if Puppet.settings.include?(v)
- puts "%s = %s" % [v, Puppet[v]]
- else
- puts "invalid parameter: %s" % v
- exit(1)
- end
- end
- else
- val.split(/\s*,\s*/).sort.each do |v|
- if Puppet.settings.include?(v)
- puts Puppet[val]
- else
- puts "invalid parameter: %s" % v
- exit(1)
- end
- end
- end
- exit(0)
- end
- if Puppet[:genconfig]
- puts Puppet.settings.to_config
- exit(0)
- end
- end
def self.genmanifest
if Puppet[:genmanifest]