diff options
Diffstat (limited to 'lib/puppet/util.rb')
-rw-r--r-- | lib/puppet/util.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index 1f974921e..02bac1b88 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -31,15 +31,15 @@ module Util if group = Puppet[:group] group = self.gid(group) unless group - raise Puppet::Error, "No such group %s" % Puppet[:group] + raise Puppet::Error, "No such group #{Puppet[:group]}" end unless Puppet::Util::SUIDManager.gid == group begin Puppet::Util::SUIDManager.egid = group Puppet::Util::SUIDManager.gid = group rescue => detail - Puppet.warning "could not change to group %s: %s" % [group.inspect, detail] - $stderr.puts "could not change to group %s" % group.inspect + Puppet.warning "could not change to group #{group.inspect}: #{detail}" + $stderr.puts "could not change to group #{group.inspect}" # Don't exit on failed group changes, since it's # not fatal @@ -51,7 +51,7 @@ module Util if user = Puppet[:user] user = self.uid(user) unless user - raise Puppet::Error, "No such user %s" % Puppet[:user] + raise Puppet::Error, "No such user #{Puppet[:user]}" end unless Puppet::Util::SUIDManager.uid == user begin @@ -59,7 +59,7 @@ module Util Puppet::Util::SUIDManager.uid = user Puppet::Util::SUIDManager.euid = user rescue => detail - $stderr.puts "Could not change to user %s: %s" % [user, detail] + $stderr.puts "Could not change to user #{user}: #{detail}" exit(74) end end @@ -135,7 +135,7 @@ module Util elsif FileTest.directory?(File.join(path)) next else FileTest.exist?(File.join(path)) - raise "Cannot create %s: basedir %s is a file" % [dir, File.join(path)] + raise "Cannot create #{dir}: basedir #{File.join(path)} is a file" end } return true @@ -173,7 +173,7 @@ module Util end unless level == :none or object.respond_to? level - raise Puppet::DevError, "Benchmarked object does not respond to %s" % level + raise Puppet::DevError, "Benchmarked object does not respond to #{level}" end # Only benchmark if our log level is high enough @@ -205,9 +205,9 @@ module Util # Execute the provided command in a pipe, yielding the pipe object. def execpipe(command, failonfail = true) if respond_to? :debug - debug "Executing '%s'" % command + debug "Executing '#{command}'" else - Puppet.debug "Executing '%s'" % command + Puppet.debug "Executing '#{command}'" end output = open("| #{command} 2>&1") do |pipe| @@ -249,9 +249,9 @@ module Util end if respond_to? :debug - debug "Executing '%s'" % str + debug "Executing '#{str}'" else - Puppet.debug "Executing '%s'" % str + Puppet.debug "Executing '#{str}'" end if arguments[:uid] @@ -321,7 +321,7 @@ module Util end # if child_pid elsif Puppet.features.microsoft_windows? command = command.collect {|part| '"' + part.gsub(/"/, '\\"') + '"'}.join(" ") if command.is_a?(Array) - Puppet.debug "Creating process '%s'" % command + Puppet.debug "Creating process '#{command}'" processinfo = Process.create( :command_line => command ) child_status = (Process.waitpid2(child_pid)[1]).to_i >> 8 end # if posix or win32 @@ -356,7 +356,7 @@ module Util if arguments[:failonfail] unless child_status == 0 - raise ExecutionFailure, "Execution of '%s' returned %s: %s" % [str, child_status, output] + raise ExecutionFailure, "Execution of '#{str}' returned #{child_status}: #{output}" end end |