diff options
| author | Michael V. O'Brien <michael@reductivelabs.com> | 2007-09-25 12:00:07 -0500 |
|---|---|---|
| committer | Michael V. O'Brien <michael@reductivelabs.com> | 2007-09-25 12:00:07 -0500 |
| commit | ff2828f5dbe68ff1cb06a3503590a3e4bd1b59e3 (patch) | |
| tree | 8c8960cac1d7b3e8b48e44163062be3b3f4c201f /ext | |
| parent | f8ab62b212788a4591276c95b5f67217f7517e4e (diff) | |
| parent | ffaa8ce07979f4db860950fa9be08ca37964206f (diff) | |
| download | puppet-ff2828f5dbe68ff1cb06a3503590a3e4bd1b59e3.tar.gz puppet-ff2828f5dbe68ff1cb06a3503590a3e4bd1b59e3.tar.xz puppet-ff2828f5dbe68ff1cb06a3503590a3e4bd1b59e3.zip | |
Merge branch 'master' of git://reductivelabs.com/puppet
Diffstat (limited to 'ext')
| -rwxr-xr-x | ext/module_puppet | 10 | ||||
| -rwxr-xr-x | ext/tools/passwd2puppet | 45 |
2 files changed, 5 insertions, 50 deletions
diff --git a/ext/module_puppet b/ext/module_puppet index cb03b6ef2..52f65b094 100755 --- a/ext/module_puppet +++ b/ext/module_puppet @@ -61,7 +61,7 @@ options = [ ] # Add all of the config parameters as valid options. -Puppet.config.addargs(options) +Puppet.settings.addargs(options) result = GetoptLong.new(*options) @@ -108,7 +108,7 @@ begin $stderr.puts detail.to_s end else - Puppet.config.handlearg(opt, arg) + Puppet.settings.handlearg(opt, arg) end } rescue GetoptLong::InvalidOption => detail @@ -121,7 +121,7 @@ end # Now parse the config if Puppet[:config] and File.exists? Puppet[:config] - Puppet.config.parse(Puppet[:config]) + Puppet.settings.parse(Puppet[:config]) end client = nil @@ -191,8 +191,8 @@ if parseonly end begin - client.getconfig - client.apply + config = client.getconfig + config.apply rescue => detail Puppet.err detail exit(1) diff --git a/ext/tools/passwd2puppet b/ext/tools/passwd2puppet deleted file mode 100755 index 29ffdbf95..000000000 --- a/ext/tools/passwd2puppet +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/ruby -w - -#-------------------- -# Convert a passwd-format file to Puppet users -# - -require 'getoptlong' - -result = GetoptLong.new( - [ "--help", "-h", GetoptLong::NO_ARGUMENT ] -) - -result.each { |opt,arg| - case opt - when "--help" - puts "There is no help yet" - exit - else - raise "Invalid option '#{opt}'" - end -} - -fields = %w{uid gid comment home shell} - -puts "user {" -ARGV.each do |file| - File.open(file) do |of| - of.sort.each do |line| - next if line =~ /^\s*#/ - next if line =~ /^\s*$/ - - ary = line.chomp.split(":") - puts " " + ary.shift + ":" - ary.shift # get rid of that password field - - puts fields.zip(ary).collect { |field, val| - " %s => \"%s\"" % [field, val] - }.join(",\n") + ";" - - end - end -end -puts "}" - -# $Id$ |
