diff options
author | Markus Roberts <Markus@reality.com> | 2010-07-09 18:07:15 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-09 18:07:15 -0700 |
commit | 543225970225de5697734bfaf0a6eee996802c04 (patch) | |
tree | ecc6f639c43cf1812e64f9c6ce7eacc0922b57ff /lib | |
parent | 8f15707251cdb58d53e82c4bbd332a38c2d31b4c (diff) | |
download | puppet-543225970225de5697734bfaf0a6eee996802c04.tar.gz puppet-543225970225de5697734bfaf0a6eee996802c04.tar.xz puppet-543225970225de5697734bfaf0a6eee996802c04.zip |
Code smell: Avoid needless decorations
* Replaced 704 occurances of (.*)\b([a-z_]+)\(\) with \1\2
3 Examples:
The code:
ctx = OpenSSL::SSL::SSLContext.new()
becomes:
ctx = OpenSSL::SSL::SSLContext.new
The code:
skip()
becomes:
skip
The code:
path = tempfile()
becomes:
path = tempfile
* Replaced 31 occurances of ^( *)end *#.* with \1end
3 Examples:
The code:
becomes:
The code:
end # Dir.foreach
becomes:
end
The code:
end # def
becomes:
end
Diffstat (limited to 'lib')
108 files changed, 219 insertions, 219 deletions
diff --git a/lib/puppet/agent.rb b/lib/puppet/agent.rb index 8d131fbc8..a01da483b 100644 --- a/lib/puppet/agent.rb +++ b/lib/puppet/agent.rb @@ -73,7 +73,7 @@ class Puppet::Agent def start # Create our timer. Puppet will handle observing it and such. timer = EventLoop::Timer.new(:interval => Puppet[:runinterval], :tolerance => 1, :start? => true) do - run() + run end # Run once before we start following the timer diff --git a/lib/puppet/application/queue.rb b/lib/puppet/application/queue.rb index 6bbff75f9..6531f6f92 100644 --- a/lib/puppet/application/queue.rb +++ b/lib/puppet/application/queue.rb @@ -40,7 +40,7 @@ class Puppet::Application::Queue < Puppet::Application def main Puppet.notice "Starting puppetqd #{Puppet.version}" Puppet::Resource::Catalog::Queue.subscribe do |catalog| - # Once you have a Puppet::Resource::Catalog instance, calling save() on it should suffice + # Once you have a Puppet::Resource::Catalog instance, calling save on it should suffice # to put it through to the database via its active_record indirector (which is determined # by the terminus_class = :active_record setting above) Puppet::Util.benchmark(:notice, "Processing queued catalog for #{catalog.name}") do diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index 82158e0fd..5b8174588 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -78,11 +78,11 @@ class Puppet::Configurer # Prepare for catalog retrieval. Downloads everything necessary, etc. def prepare - dostorage() + dostorage - download_plugins() + download_plugins - download_fact_plugins() + download_fact_plugins execute_prerun_command end @@ -93,7 +93,7 @@ class Puppet::Configurer # This is a bit complicated. We need the serialized and escaped facts, # and we need to know which format they're encoded in. Thus, we # get a hash with both of these pieces of information. - fact_options = facts_for_uploading() + fact_options = facts_for_uploading else fact_options = {} end @@ -126,7 +126,7 @@ class Puppet::Configurer # which accepts :tags and :ignoreschedules. def run(options = {}) begin - prepare() + prepare rescue SystemExit,NoMemoryError raise rescue Exception => detail @@ -134,7 +134,7 @@ class Puppet::Configurer Puppet.err "Failed to prepare catalog: #{detail}" end - options[:report] ||= initialize_report() + options[:report] ||= initialize_report report = options[:report] Puppet::Util::Log.newdestination(report) @@ -171,7 +171,7 @@ class Puppet::Configurer def send_report(report, trans = nil) trans.generate_report if trans puts report.summary if Puppet[:summarize] - report.save() if Puppet[:report] + report.save if Puppet[:report] rescue => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Could not send report: #{detail}" diff --git a/lib/puppet/configurer/fact_handler.rb b/lib/puppet/configurer/fact_handler.rb index 74bea1998..2d1565ae7 100644 --- a/lib/puppet/configurer/fact_handler.rb +++ b/lib/puppet/configurer/fact_handler.rb @@ -15,7 +15,7 @@ module Puppet::Configurer::FactHandler # finding facts and the 'rest' terminus for caching them. Thus, we'll # compile them and then "cache" them on the server. begin - reload_facter() + reload_facter Puppet::Node::Facts.find(Puppet[:certname]) rescue SystemExit,NoMemoryError raise @@ -67,6 +67,6 @@ module Puppet::Configurer::FactHandler # This loads all existing facts and any new ones. We have to remove and # reload because there's no way to unload specific facts. - Puppet::Node::Facts::Facter.load_fact_plugins() + Puppet::Node::Facts::Facter.load_fact_plugins end end diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb index 7e2fc7555..b0c2b56ea 100755 --- a/lib/puppet/daemon.rb +++ b/lib/puppet/daemon.rb @@ -14,12 +14,12 @@ class Puppet::Daemon # Put the daemon into the background. def daemonize - if pid = fork() + if pid = fork Process.detach(pid) exit(0) end - create_pidfile() + create_pidfile # Get rid of console logging Puppet::Util::Log.close(:console) @@ -108,7 +108,7 @@ class Puppet::Daemon server.stop if server - remove_pidfile() + remove_pidfile Puppet::Util::Log.close_all diff --git a/lib/puppet/external/dot.rb b/lib/puppet/external/dot.rb index 77d66e92e..5d89ddbc9 100644 --- a/lib/puppet/external/dot.rb +++ b/lib/puppet/external/dot.rb @@ -229,7 +229,7 @@ module DOT t + "]\n" end - end # class DOTNode + end # A subgraph element is the same to graph, but has another header in dot # notation. @@ -276,7 +276,7 @@ module DOT hdr + options + nodes + t + "}\n" end - end # class DOTSubgraph + end # This is a graph. @@ -287,7 +287,7 @@ module DOT @dot_string = 'digraph' end - end # class DOTDigraph + end # This is an edge. @@ -314,7 +314,7 @@ module DOT }.compact.join( "\n" ) + "\n#{t}]\n" end - end # class DOTEdge + end class DOTDirectedEdge < DOTEdge @@ -322,5 +322,5 @@ module DOT '->' end - end # class DOTDirectedEdge -end # module DOT + end +end diff --git a/lib/puppet/external/nagios/parser.rb b/lib/puppet/external/nagios/parser.rb index 934af146e..43444cccb 100644 --- a/lib/puppet/external/nagios/parser.rb +++ b/lib/puppet/external/nagios/parser.rb @@ -99,7 +99,7 @@ module Racc ### def do_parse - __send__(Racc_Main_Parsing_Routine, _racc_setup(), false) + __send__(Racc_Main_Parsing_Routine, _racc_setup, false) end def next_token @@ -121,7 +121,7 @@ module Racc if i = action_pointer[@racc_state[-1]] if @racc_read_next if @racc_t != 0 # not EOF - tok, @racc_val = next_token() + tok, @racc_val = next_token unless tok # EOF @racc_t = 0 else @@ -152,7 +152,7 @@ module Racc ### def yyparse(recv, mid) - __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), true) + __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup, true) end def _racc_yyparse_rb(recv, mid, arg, c_debug) @@ -770,6 +770,6 @@ def _reduce_none( val, _values, result ) result end - end # class Parser + end -end # module Nagios +end diff --git a/lib/puppet/feature/rack.rb b/lib/puppet/feature/rack.rb index 081b9e9fb..b91aa13b7 100644 --- a/lib/puppet/feature/rack.rb +++ b/lib/puppet/feature/rack.rb @@ -13,7 +13,7 @@ Puppet.features.add(:rack) do if ! (defined?(::Rack) and defined?(::Rack.release)) false else - major_version = ::Rack.release().split('.')[0].to_i + major_version = ::Rack.release.split('.')[0].to_i if major_version >= 1 true else diff --git a/lib/puppet/file_serving/base.rb b/lib/puppet/file_serving/base.rb index 707713082..379012f76 100644 --- a/lib/puppet/file_serving/base.rb +++ b/lib/puppet/file_serving/base.rb @@ -68,7 +68,7 @@ class Puppet::FileServing::Base # Stat our file, using the appropriate link-sensitive method. def stat @stat_method ||= self.links == :manage ? :lstat : :stat - File.send(@stat_method, full_path()) + File.send(@stat_method, full_path) end def to_pson_data_hash diff --git a/lib/puppet/file_serving/configuration.rb b/lib/puppet/file_serving/configuration.rb index 5f958eb1d..425213e77 100644 --- a/lib/puppet/file_serving/configuration.rb +++ b/lib/puppet/file_serving/configuration.rb @@ -15,7 +15,7 @@ class Puppet::FileServing::Configuration class << self include Puppet::Util::Cacher - cached_attr(:configuration) { new() } + cached_attr(:configuration) { new } end Mount = Puppet::FileServing::Mount diff --git a/lib/puppet/file_serving/configuration/parser.rb b/lib/puppet/file_serving/configuration/parser.rb index b86ff1ac9..8e25933e4 100644 --- a/lib/puppet/file_serving/configuration/parser.rb +++ b/lib/puppet/file_serving/configuration/parser.rb @@ -44,7 +44,7 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile } } - validate() + validate @mounts end diff --git a/lib/puppet/file_serving/content.rb b/lib/puppet/file_serving/content.rb index cacd908e8..a7fd2045d 100644 --- a/lib/puppet/file_serving/content.rb +++ b/lib/puppet/file_serving/content.rb @@ -37,14 +37,14 @@ class Puppet::FileServing::Content < Puppet::FileServing::Base def content unless @content # This stat can raise an exception, too. - raise(ArgumentError, "Cannot read the contents of links unless following links") if stat().ftype == "symlink" + raise(ArgumentError, "Cannot read the contents of links unless following links") if stat.ftype == "symlink" - @content = ::File.read(full_path()) + @content = ::File.read(full_path) end @content end def to_raw - File.new(full_path(), "r") + File.new(full_path, "r") end end diff --git a/lib/puppet/file_serving/metadata.rb b/lib/puppet/file_serving/metadata.rb index 87d3f138e..ca58669ac 100644 --- a/lib/puppet/file_serving/metadata.rb +++ b/lib/puppet/file_serving/metadata.rb @@ -45,7 +45,7 @@ class Puppet::FileServing::Metadata < Puppet::FileServing::Base # Note that File.stat raises Errno::ENOENT if the file is absent and this # method does not catch that exception. def collect - real_path = full_path() + real_path = full_path stat = stat() @owner = stat.uid @group = stat.gid diff --git a/lib/puppet/file_serving/mount/file.rb b/lib/puppet/file_serving/mount/file.rb index d934d1d10..1daaceaed 100644 --- a/lib/puppet/file_serving/mount/file.rb +++ b/lib/puppet/file_serving/mount/file.rb @@ -94,7 +94,7 @@ class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount else Puppet.notice "No client; expanding '#{path}' with local host" # Else, use the local information - map = localmap() + map = localmap end path.gsub(/%(.)/) do |v| diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb index 3a59f3ec5..2b7da22ec 100644 --- a/lib/puppet/indirector/indirection.rb +++ b/lib/puppet/indirector/indirection.rb @@ -78,7 +78,7 @@ class Puppet::Indirector::Indirection text += scrub(@doc) + "\n\n" if @doc - if s = terminus_setting() + if s = terminus_setting text += "* **Terminus Setting**: #{terminus_setting}" end diff --git a/lib/puppet/indirector/node/ldap.rb b/lib/puppet/indirector/node/ldap.rb index 93da5a831..9e4326273 100644 --- a/lib/puppet/indirector/node/ldap.rb +++ b/lib/puppet/indirector/node/ldap.rb @@ -14,7 +14,7 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap end # Separate this out so it's relatively atomic. It's tempting to call - # process() instead of name2hash() here, but it ends up being + # process instead of name2hash() here, but it ends up being # difficult to test because all exceptions get caught by ldapsearch. # LAK:NOTE Unfortunately, the ldap support is too stupid to throw anything # but LDAP::ResultError, even on bad connections, so we are rough handed diff --git a/lib/puppet/indirector/report/processor.rb b/lib/puppet/indirector/report/processor.rb index 80570d9c3..2f8e9f3c1 100644 --- a/lib/puppet/indirector/report/processor.rb +++ b/lib/puppet/indirector/report/processor.rb @@ -22,7 +22,7 @@ class Puppet::Transaction::Report::Processor < Puppet::Indirector::Code def process(report) return if Puppet[:reports] == "none" - reports().each do |name| + reports.each do |name| if mod = Puppet::Reports.report(name) # We have to use a dup because we're including a module in the # report. diff --git a/lib/puppet/indirector/request.rb b/lib/puppet/indirector/request.rb index ffc2d3189..759b44211 100644 --- a/lib/puppet/indirector/request.rb +++ b/lib/puppet/indirector/request.rb @@ -21,7 +21,7 @@ class Puppet::Indirector::Request end def environment - @environment ||= Puppet::Node::Environment.new() + @environment ||= Puppet::Node::Environment.new end def environment=(env) diff --git a/lib/puppet/metatype/manager.rb b/lib/puppet/metatype/manager.rb index 118862bc7..51068f6be 100644 --- a/lib/puppet/metatype/manager.rb +++ b/lib/puppet/metatype/manager.rb @@ -42,7 +42,7 @@ module Manager newmethod = "new#{name.to_s}" # Used for method manipulation. - selfobj = singleton_class() + selfobj = singleton_class @types ||= {} @@ -94,7 +94,7 @@ module Manager ) # We have to load everything so that we can figure out the default type. - klass.providerloader.loadall() + klass.providerloader.loadall klass end diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb index a7883bcdd..b4184dde5 100644 --- a/lib/puppet/module.rb +++ b/lib/puppet/module.rb @@ -48,7 +48,7 @@ class Puppet::Module def initialize(name, environment = nil) @name = name - assert_validity() + assert_validity if environment.is_a?(Puppet::Node::Environment) @environment = environment diff --git a/lib/puppet/network/authconfig.rb b/lib/puppet/network/authconfig.rb index 932d6da6d..ba2caa473 100644 --- a/lib/puppet/network/authconfig.rb +++ b/lib/puppet/network/authconfig.rb @@ -6,7 +6,7 @@ module Puppet class Network::AuthConfig < Puppet::Util::LoadedFile def self.main - @main ||= self.new() + @main ||= self.new end # Just proxy the setting methods to our rights stuff @@ -23,7 +23,7 @@ module Puppet namespace = request.handler.intern method = request.method.intern - read() + read if @rights.include?(name) return @rights[name].allowed?(request.name, request.ip) @@ -49,7 +49,7 @@ module Puppet @configstamp = @configstatted = nil @configtimeout = 60 - read() if parsenow + read if parsenow end # Read the configuration file. @@ -75,7 +75,7 @@ module Puppet end end - parse() + parse @configstamp = File.stat(@file).ctime @configstatted = Time.now diff --git a/lib/puppet/network/authorization.rb b/lib/puppet/network/authorization.rb index 3d47ea315..12459a5d1 100644 --- a/lib/puppet/network/authorization.rb +++ b/lib/puppet/network/authorization.rb @@ -10,7 +10,7 @@ module Puppet::Network # Create our config object if necessary. This works even if # there's no configuration file. def authconfig - @authconfig ||= Puppet::Network::AuthConfig.main() + @authconfig ||= Puppet::Network::AuthConfig.main @authconfig end diff --git a/lib/puppet/network/client.rb b/lib/puppet/network/client.rb index f9c50cd60..e406ae8cf 100644 --- a/lib/puppet/network/client.rb +++ b/lib/puppet/network/client.rb @@ -146,7 +146,7 @@ class Puppet::Network::Client else self.stopping = true Puppet::Util::Storage.store if self.respond_to? :running? and self.running? - rmpidfile() + rmpidfile end end diff --git a/lib/puppet/network/client/runner.rb b/lib/puppet/network/client/runner.rb index c6ba328b4..68005c9f0 100644 --- a/lib/puppet/network/client/runner.rb +++ b/lib/puppet/network/client/runner.rb @@ -2,7 +2,7 @@ class Puppet::Network::Client::Runner < Puppet::Network::Client::ProxyClient self.mkmethods def initialize(hash = {}) - hash[:Runner] = self.class.handler.new() if hash.include?(:Runner) + hash[:Runner] = self.class.handler.new if hash.include?(:Runner) super(hash) end diff --git a/lib/puppet/network/format.rb b/lib/puppet/network/format.rb index bdaee0fec..2b5b89279 100644 --- a/lib/puppet/network/format.rb +++ b/lib/puppet/network/format.rb @@ -24,7 +24,7 @@ class Puppet::Network::Format @options = options # This must be done early the values can be used to set required_methods - define_method_names() + define_method_names method_list = { :intern_method => "from_#{name}", diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index 1131e434a..0a5082012 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -112,7 +112,7 @@ class Puppet::Network::Handler if configuration readconfig(false) # don't check the file the first time. else - create_default_mounts() + create_default_mounts end end end @@ -424,7 +424,7 @@ class Puppet::Network::Handler else Puppet.notice "No client; expanding '#{path}' with local host" # Else, use the local information - map = localmap() + map = localmap end path.gsub(/%(.)/) do |v| key = $1 diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index 6f2c238a2..6696df448 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -33,7 +33,7 @@ class Puppet::Network::Handler args[:Local] = true - @ca = (hash.include?(:CA) and hash[:CA]) ? Puppet::SSLCertificates::CA.new() : nil + @ca = (hash.include?(:CA) and hash[:CA]) ? Puppet::SSLCertificates::CA.new : nil # This is only used by the cfengine module, or if --loadclasses was # specified in +puppet+. diff --git a/lib/puppet/network/handler/report.rb b/lib/puppet/network/handler/report.rb index 50e2fbfea..d935d3822 100755 --- a/lib/puppet/network/handler/report.rb +++ b/lib/puppet/network/handler/report.rb @@ -52,7 +52,7 @@ class Puppet::Network::Handler # Used for those reports that accept yaml client = report.host - reports().each do |name| + reports.each do |name| if mod = Puppet::Reports.report(name) # We have to use a dup because we're including a module in the # report. diff --git a/lib/puppet/network/http/compression.rb b/lib/puppet/network/http/compression.rb index 923262b98..bb06a5770 100644 --- a/lib/puppet/network/http/compression.rb +++ b/lib/puppet/network/http/compression.rb @@ -20,7 +20,7 @@ module Puppet::Network::HTTP::Compression when 'gzip' return Zlib::GzipReader.new(StringIO.new(response.body)).read when 'deflate' - return Zlib::Inflate.new().inflate(response.body) + return Zlib::Inflate.new.inflate(response.body) when nil, 'identity' return response.body else diff --git a/lib/puppet/network/http/rack.rb b/lib/puppet/network/http/rack.rb index a5f69612d..b7da1fcf7 100644 --- a/lib/puppet/network/http/rack.rb +++ b/lib/puppet/network/http/rack.rb @@ -11,7 +11,7 @@ class Puppet::Network::HTTP::Rack protocols = args[:protocols] # Always prepare a REST handler - @rest_http_handler = Puppet::Network::HTTP::RackREST.new() + @rest_http_handler = Puppet::Network::HTTP::RackREST.new protocols.delete :rest # Prepare the XMLRPC handler, for backward compatibility (if requested) @@ -33,7 +33,7 @@ class Puppet::Network::HTTP::Rack # * Return the response (in rack-format) to our caller. def call(env) request = Rack::Request.new(env) - response = Rack::Response.new() + response = Rack::Response.new Puppet.debug 'Handling request: %s %s' % [request.request_method, request.fullpath] # if we shall serve XMLRPC, have /RPC2 go to the xmlrpc handler @@ -56,7 +56,7 @@ class Puppet::Network::HTTP::Rack Puppet.err "Backtrace:" detail.backtrace.each { |line| Puppet.err " > #{line}" } end - response.finish() + response.finish end end diff --git a/lib/puppet/network/http/rack/httphandler.rb b/lib/puppet/network/http/rack/httphandler.rb index e14206850..fed06f880 100644 --- a/lib/puppet/network/http/rack/httphandler.rb +++ b/lib/puppet/network/http/rack/httphandler.rb @@ -3,7 +3,7 @@ require 'puppet/ssl/certificate' class Puppet::Network::HTTP::RackHttpHandler - def initialize() + def initialize end # do something useful with request (a Rack::Request) and use diff --git a/lib/puppet/network/http/rack/xmlrpc.rb b/lib/puppet/network/http/rack/xmlrpc.rb index 9192b1d48..c3209a686 100644 --- a/lib/puppet/network/http/rack/xmlrpc.rb +++ b/lib/puppet/network/http/rack/xmlrpc.rb @@ -23,7 +23,7 @@ class Puppet::Network::HTTP::RackXMLRPC < Puppet::Network::HTTP::RackHttpHandler response.write 'Method Not Allowed' return end - if request.media_type() != "text/xml" + if request.media_type != "text/xml" response.status = 400 response.write 'Bad Request' return @@ -32,7 +32,7 @@ class Puppet::Network::HTTP::RackXMLRPC < Puppet::Network::HTTP::RackHttpHandler # get auth/certificate data client_request = build_client_request(request) - response_body = @xmlrpc_server.process(request.body.read(), client_request) + response_body = @xmlrpc_server.process(request.body.read, client_request) response.status = 200 response['Content-Type'] = 'text/xml; charset=utf-8' diff --git a/lib/puppet/network/http/webrick/rest.rb b/lib/puppet/network/http/webrick/rest.rb index 9a8bf0a83..7526099ee 100644 --- a/lib/puppet/network/http/webrick/rest.rb +++ b/lib/puppet/network/http/webrick/rest.rb @@ -18,7 +18,7 @@ class Puppet::Network::HTTP::WEBrickREST < WEBrick::HTTPServlet::AbstractServlet result.merge(client_information(request)) end - # WEBrick uses a service() method to respond to requests. Simply delegate to the handler response() method. + # WEBrick uses a service method to respond to requests. Simply delegate to the handler response method. def service(request, response) process(request, response) end diff --git a/lib/puppet/network/rest_authconfig.rb b/lib/puppet/network/rest_authconfig.rb index b22a31461..d233c8775 100644 --- a/lib/puppet/network/rest_authconfig.rb +++ b/lib/puppet/network/rest_authconfig.rb @@ -30,7 +30,7 @@ module Puppet # raise an Puppet::Network::AuthorizedError if the request # is denied. def allowed?(request) - read() + read # we're splitting the request in part because # fail_on_deny could as well be called in the XMLRPC context @@ -54,7 +54,7 @@ module Puppet @rights ||= Puppet::Network::Rights.new end - def parse() + def parse super() insert_default_acl end diff --git a/lib/puppet/network/rights.rb b/lib/puppet/network/rights.rb index 63ebae892..a57260aa3 100755 --- a/lib/puppet/network/rights.rb +++ b/lib/puppet/network/rights.rb @@ -79,7 +79,7 @@ class Rights raise error end - def initialize() + def initialize @rights = [] end diff --git a/lib/puppet/network/server.rb b/lib/puppet/network/server.rb index 9f4b5243b..e4945bec9 100644 --- a/lib/puppet/network/server.rb +++ b/lib/puppet/network/server.rb @@ -6,7 +6,7 @@ class Puppet::Network::Server # Put the daemon into the background. def daemonize - if pid = fork() + if pid = fork Process.detach(pid) exit(0) end @@ -58,7 +58,7 @@ class Puppet::Network::Server http_server_class || raise(ArgumentError, "Could not determine HTTP Server class for server type [#{@server_type}]") @port = args[:port] || Puppet[:masterport] || raise(ArgumentError, "Must specify :port or configure Puppet :masterport") - @address = determine_bind_address() + @address = determine_bind_address @protocols = [ :rest, :xmlrpc ] @listening = false diff --git a/lib/puppet/network/xmlrpc/processor.rb b/lib/puppet/network/xmlrpc/processor.rb index e016b177b..9d3904fce 100644 --- a/lib/puppet/network/xmlrpc/processor.rb +++ b/lib/puppet/network/xmlrpc/processor.rb @@ -31,7 +31,7 @@ module Puppet::Network # default in that it expects a ClientRequest object in addition to the # data. def process(data, request) - call, params = parser().parseMethodCall(data) + call, params = parser.parseMethodCall(data) params << request.name << request.ip handler, method = call.split(".") request.handler = handler diff --git a/lib/puppet/network/xmlrpc/server.rb b/lib/puppet/network/xmlrpc/server.rb index e7435268a..8fdf02b2c 100644 --- a/lib/puppet/network/xmlrpc/server.rb +++ b/lib/puppet/network/xmlrpc/server.rb @@ -12,7 +12,7 @@ module Puppet::Network def initialize super() - setup_processor() + setup_processor end end end diff --git a/lib/puppet/network/xmlrpc/webrick_servlet.rb b/lib/puppet/network/xmlrpc/webrick_servlet.rb index 890f2990e..035448a86 100644 --- a/lib/puppet/network/xmlrpc/webrick_servlet.rb +++ b/lib/puppet/network/xmlrpc/webrick_servlet.rb @@ -28,7 +28,7 @@ module Puppet::Network::XMLRPC # and we can consume them all ourselves super() - setup_processor() + setup_processor # Set up each of the passed handlers. handlers.each do |handler| @@ -37,7 +37,7 @@ module Puppet::Network::XMLRPC end # Handle the actual request. We can't use the super() method, because - # we need to pass a ClientRequest object to process() so we can do + # we need to pass a ClientRequest object to process so we can do # authorization. It's the only way to stay thread-safe. def service(request, response) if @valid_ip diff --git a/lib/puppet/parameter.rb b/lib/puppet/parameter.rb index b3ec1717a..be44b3e5b 100644 --- a/lib/puppet/parameter.rb +++ b/lib/puppet/parameter.rb @@ -193,7 +193,7 @@ class Puppet::Parameter self.class.metaparam end - # each parameter class must define the name() method, and parameter + # each parameter class must define the name method, and parameter # instances do not change that name this implicitly means that a given # object can only have one parameter instance of a given parameter # class diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 01892ee44..17b05baab 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -94,20 +94,20 @@ class Puppet::Parser::Compiler # This is the main entry into our catalog. def compile # Set the client's parameters into the top scope. - set_node_parameters() + set_node_parameters create_settings_scope - evaluate_main() + evaluate_main - evaluate_ast_node() + evaluate_ast_node - evaluate_node_classes() + evaluate_node_classes - evaluate_generators() + evaluate_generators - finish() + finish - fail_on_unevaluated() + fail_on_unevaluated @catalog end @@ -177,7 +177,7 @@ class Puppet::Parser::Compiler end end - initvars() + initvars end # Create a new scope, with either a specified parent scope or @@ -352,7 +352,7 @@ class Puppet::Parser::Compiler # Make sure all of our resources and such have done any last work # necessary. def finish - evaluate_relationships() + evaluate_relationships resources.each do |resource| # Add in any resource overrides. diff --git a/lib/puppet/parser/functions/shellquote.rb b/lib/puppet/parser/functions/shellquote.rb index 96feaa1ee..888b9769d 100644 --- a/lib/puppet/parser/functions/shellquote.rb +++ b/lib/puppet/parser/functions/shellquote.rb @@ -10,7 +10,7 @@ module Puppet::Parser::Functions with spaces. If an argument is an array, the elements of that array is interpolated within the rest of the arguments; this makes it possible to have an array of arguments and pass that array to - shellquote() instead of having to specify each argument + shellquote instead of having to specify each argument individually in the call. ") \ do |args| @@ -25,9 +25,9 @@ module Puppet::Parser::Functions result << ("'" + word + "'") else r = '"' - word.each_byte() do |c| + word.each_byte do |c| r += "\\" if Dangerous.include?(c) - r += c.chr() + r += c.chr end r += '"' result << r diff --git a/lib/puppet/parser/functions/sprintf.rb b/lib/puppet/parser/functions/sprintf.rb index 4a3916c89..af0a7213e 100644 --- a/lib/puppet/parser/functions/sprintf.rb +++ b/lib/puppet/parser/functions/sprintf.rb @@ -5,9 +5,9 @@ module Puppet::Parser::Functions :doc => "Perform printf-style formatting of text. - The first parameter is format string describing how the rest of the parameters should be formatted. See the documentation for the ``Kernel::sprintf()`` function in Ruby for all the details.") do |args| + The first parameter is format string describing how the rest of the parameters should be formatted. See the documentation for the ``Kernel::sprintf`` function in Ruby for all the details.") do |args| raise Puppet::ParseError, 'sprintf() needs at least one argument' if args.length < 1 - fmt = args.shift() + fmt = args.shift return sprintf(fmt, *args) end end diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb index 7668722d4..0c95142f9 100644 --- a/lib/puppet/parser/lexer.rb +++ b/lib/puppet/parser/lexer.rb @@ -368,7 +368,7 @@ class Puppet::Parser::Lexer def initialize @find = 0 @regex = 0 - initvars() + initvars end def initvars @@ -396,7 +396,7 @@ class Puppet::Parser::Lexer def munge_token(token, value) @line += 1 if token.incr_line - skip() if token.skip_text + skip if token.skip_text return if token.skip and not token.accumulate? @@ -442,7 +442,7 @@ class Puppet::Parser::Lexer lex_error "Invalid or empty string" unless @scanner # Skip any initial whitespace. - skip() + skip until token_queue.empty? and @scanner.eos? do yielded = false @@ -460,7 +460,7 @@ class Puppet::Parser::Lexer final_token, token_value = munge_token(matched_token, value) unless final_token - skip() + skip next end @@ -496,7 +496,7 @@ class Puppet::Parser::Lexer end end @previous_token = final_token - skip() + skip end @scanner = nil diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb index 18d17252c..8dd986bd5 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -117,12 +117,12 @@ class Puppet::Parser::Parser def initialize(env) # The environment is needed to know how to find the resource type collection. @environment = env.is_a?(String) ? Puppet::Node::Environment.new(env) : env - initvars() + initvars end # Initialize or reset all of our variables. def initvars - @lexer = Puppet::Parser::Lexer.new() + @lexer = Puppet::Parser::Lexer.new end # Split an fq name into a namespace and name diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index ba2a5f3b0..2d31b40e7 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -68,7 +68,7 @@ class Puppet::Parser::Resource < Puppet::Resource # Retrieve the associated definition and evaluate it. def evaluate if klass = resource_type and ! builtin_type? - finish() + finish return klass.evaluate_code(self) elsif builtin? devfail "Cannot evaluate a builtin type (#{type})" @@ -95,9 +95,9 @@ class Puppet::Parser::Resource < Puppet::Resource def finish return if finished? @finished = true - add_defaults() - add_metaparams() - validate() + add_defaults + add_metaparams + validate end # Has this resource already been finished? diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index 3bda512d7..9b49ab680 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -140,7 +140,7 @@ class Puppet::Parser::Scope end } - extend_with_functions_module() + extend_with_functions_module @tags = [] diff --git a/lib/puppet/parser/yaml_trimmer.rb b/lib/puppet/parser/yaml_trimmer.rb index 09159e38f..131bafb8d 100644 --- a/lib/puppet/parser/yaml_trimmer.rb +++ b/lib/puppet/parser/yaml_trimmer.rb @@ -3,7 +3,7 @@ module Puppet::Parser::YamlTrimmer def to_yaml_properties r = instance_variables - REMOVE - r -= skip_for_yaml() if respond_to?(:skip_for_yaml) + r -= skip_for_yaml if respond_to?(:skip_for_yaml) r end end diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb index d86c1fdc0..c7165fe6e 100644 --- a/lib/puppet/property.rb +++ b/lib/puppet/property.rb @@ -201,7 +201,7 @@ class Puppet::Property < Puppet::Parameter super end - # each property class must define the name() method, and property instances + # each property class must define the name method, and property instances # do not change that name # this implicitly means that a given object can only have one property # instance of a given property class diff --git a/lib/puppet/provider.rb b/lib/puppet/provider.rb index 67d008956..859a34658 100644 --- a/lib/puppet/provider.rb +++ b/lib/puppet/provider.rb @@ -219,8 +219,8 @@ class Puppet::Provider end dochook(:features) do - if features().length > 0 - return " Supported features: " + features().collect do |f| + if features.length > 0 + return " Supported features: " + features.collect do |f| "``#{f}``" end.join(", ") + "." end diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb index 73ca78cf5..7dd41c642 100755 --- a/lib/puppet/provider/cron/crontab.rb +++ b/lib/puppet/provider/cron/crontab.rb @@ -104,7 +104,7 @@ tab = case Facter.value(:operatingsystem) # Then the normal fields. matched = true - record_type(record[:record_type]).fields().each do |field| + record_type(record[:record_type]).fields.each do |field| next if field == :command next if field == :special if record[field] and ! resource.value(field) diff --git a/lib/puppet/provider/mailalias/aliases.rb b/lib/puppet/provider/mailalias/aliases.rb index 77b29114f..388fd631c 100755 --- a/lib/puppet/provider/mailalias/aliases.rb +++ b/lib/puppet/provider/mailalias/aliases.rb @@ -23,8 +23,8 @@ require 'puppet/provider/parsedfile' def process(line) ret = {} records = line.split(':',2) - ret[:name] = records[0].strip() - ret[:recipient] = records[1].strip() + ret[:name] = records[0].strip + ret[:recipient] = records[1].strip ret end diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb index 86361969c..2136339a3 100644 --- a/lib/puppet/provider/mount.rb +++ b/lib/puppet/provider/mount.rb @@ -23,8 +23,8 @@ module Puppet::Provider::Mount if resource[:remounts] == :true mountcmd "-o", "remount", resource[:name] else - unmount() - mount() + unmount + mount end end diff --git a/lib/puppet/provider/nameservice.rb b/lib/puppet/provider/nameservice.rb index 3f485c3af..6564a4154 100644 --- a/lib/puppet/provider/nameservice.rb +++ b/lib/puppet/provider/nameservice.rb @@ -205,7 +205,7 @@ class Puppet::Provider::NameService < Puppet::Provider # Retrieve what we can about our object def getinfo(refresh) if @objectinfo.nil? or refresh == true - @etcmethod ||= ("get" + self.class.section().to_s + "nam").intern + @etcmethod ||= ("get" + self.class.section.to_s + "nam").intern begin @objectinfo = Etc.send(@etcmethod, @resource[:name]) rescue ArgumentError => detail diff --git a/lib/puppet/provider/nameservice/directoryservice.rb b/lib/puppet/provider/nameservice/directoryservice.rb index b98a38c12..060ed4c31 100644 --- a/lib/puppet/provider/nameservice/directoryservice.rb +++ b/lib/puppet/provider/nameservice/directoryservice.rb @@ -30,7 +30,7 @@ class DirectoryService < Puppet::Provider::NameService attr_writer :macosx_version_major end - initvars() + initvars commands :dscl => "/usr/bin/dscl" commands :dseditgroup => "/usr/sbin/dseditgroup" @@ -181,7 +181,7 @@ class DirectoryService < Puppet::Provider::NameService def self.generate_attribute_hash(input_hash, *type_properties) attribute_hash = {} - input_hash.keys().each do |key| + input_hash.keys.each do |key| ds_attribute = key.sub("dsAttrTypeStandard:", "") next unless (@@ds_to_ns_attribute_map.keys.include?(ds_attribute) and type_properties.include? @@ds_to_ns_attribute_map[ds_attribute]) ds_value = input_hash[key] @@ -219,7 +219,7 @@ class DirectoryService < Puppet::Provider::NameService # This class method returns nil if the object doesn't exist # Otherwise, it returns a hash of the object properties. - all_present_str_array = list_all_present() + all_present_str_array = list_all_present # NBK: shortcut the process if the resource is missing return nil unless all_present_str_array.include? resource_name diff --git a/lib/puppet/provider/package/appdmg.rb b/lib/puppet/provider/package/appdmg.rb index 540bcb1ad..11858114d 100644 --- a/lib/puppet/provider/package/appdmg.rb +++ b/lib/puppet/provider/package/appdmg.rb @@ -81,16 +81,16 @@ Puppet::Type.type(:package).provide(:appdmg, :parent => Puppet::Provider::Packag }.each do |pkg| installapp("#{fspath}/#{pkg}", name, source) end - end # mounts.each do + end ensure hdiutil "eject", mounts[0] - end # begin - end # open() do + end + end ensure # JJM Remove the file if open-uri didn't already do so. File.unlink(cached_source) if File.exist?(cached_source) - end # begin - end # def self.installpkgdmg + end + end def query FileTest.exists?("/var/db/.puppet_appdmg_installed_#{@resource[:name]}") ? {:name => @resource[:name], :ensure => :present} : nil diff --git a/lib/puppet/provider/package/apt.rb b/lib/puppet/provider/package/apt.rb index a26b61159..deab23428 100755 --- a/lib/puppet/provider/package/apt.rb +++ b/lib/puppet/provider/package/apt.rb @@ -41,7 +41,7 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do self.run_preseed if @resource[:responsefile] should = @resource[:ensure] - checkforcdrom() + checkforcdrom cmd = %w{-q -y} keep = "" diff --git a/lib/puppet/provider/package/darwinport.rb b/lib/puppet/provider/package/darwinport.rb index 6ba7c5772..c746cc3b3 100755 --- a/lib/puppet/provider/package/darwinport.rb +++ b/lib/puppet/provider/package/darwinport.rb @@ -80,7 +80,7 @@ Puppet::Type.type(:package).provide :darwinport, :parent => Puppet::Provider::Pa end def update - install() + install end end diff --git a/lib/puppet/provider/package/openbsd.rb b/lib/puppet/provider/package/openbsd.rb index 4a19a883c..f6005efa7 100755 --- a/lib/puppet/provider/package/openbsd.rb +++ b/lib/puppet/provider/package/openbsd.rb @@ -16,7 +16,7 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa packages = [] begin - execpipe(listcmd()) do |process| + execpipe(listcmd) do |process| # our regex for matching pkg_info output regex = /^(.*)-(\d[^-]*)[-]?(\D*)(.*)$/ fields = [:name, :ensure, :flavor ] @@ -24,7 +24,7 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa # now turn each returned line into a package object process.each { |line| - if match = regex.match(line.split()[0]) + if match = regex.match(line.split[0]) fields.zip(match.captures) { |field,value| hash[field] = value } @@ -83,7 +83,7 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa master_version = 0 process.each do |line| - if match = regex.match(line.split()[0]) + if match = regex.match(line.split[0]) # now we return the first version, unless ensure is latest version = match.captures[1] return version unless @resource[:ensure] == "latest" diff --git a/lib/puppet/provider/package/ports.rb b/lib/puppet/provider/package/ports.rb index 014f31530..1b8f0fb8c 100755 --- a/lib/puppet/provider/package/ports.rb +++ b/lib/puppet/provider/package/ports.rb @@ -89,7 +89,7 @@ Puppet::Type.type(:package).provide :ports, :parent => :freebsd, :source => :fre end def update - install() + install end end diff --git a/lib/puppet/provider/package/portupgrade.rb b/lib/puppet/provider/package/portupgrade.rb index c3aea98bf..08cb52f47 100644 --- a/lib/puppet/provider/package/portupgrade.rb +++ b/lib/puppet/provider/package/portupgrade.rb @@ -202,7 +202,7 @@ Puppet::Type.type(:package).provide :portupgrade, :parent => Puppet::Provider::P return nil end - end # def query + end ####### Uninstall command diff --git a/lib/puppet/provider/parsedfile.rb b/lib/puppet/provider/parsedfile.rb index 6104c0c8e..811607abb 100755 --- a/lib/puppet/provider/parsedfile.rb +++ b/lib/puppet/provider/parsedfile.rb @@ -131,7 +131,7 @@ class Puppet::Provider::ParsedFile < Puppet::Provider define_method(attr) do # if @property_hash.empty? # # Note that this swaps the provider out from under us. -# prefetch() +# prefetch # if @resource.provider == self # return @property_hash[attr] # else @@ -162,7 +162,7 @@ class Puppet::Provider::ParsedFile < Puppet::Provider # Always make the resource methods. def self.resource_type=(resource) super - mk_resource_methods() + mk_resource_methods end # Mark a target as modified so we know to flush it. This only gets @@ -310,7 +310,7 @@ class Puppet::Provider::ParsedFile < Puppet::Provider @property_hash[property] = value end end - mark_target_modified() + mark_target_modified (@resource.class.name.to_s + "_created").intern end diff --git a/lib/puppet/provider/service/debian.rb b/lib/puppet/provider/service/debian.rb index 1f95d66f7..746ed1ce3 100755 --- a/lib/puppet/provider/service/debian.rb +++ b/lib/puppet/provider/service/debian.rb @@ -27,7 +27,7 @@ Puppet::Type.type(:service).provide :debian, :parent => :init do end def enabled? - # TODO: Replace system() call when Puppet::Util.execute gives us a way + # TODO: Replace system call when Puppet::Util.execute gives us a way # to determine exit status. http://projects.reductivelabs.com/issues/2538 system("/usr/sbin/invoke-rc.d", "--quiet", "--query", @resource[:name], "start") diff --git a/lib/puppet/provider/user/ldap.rb b/lib/puppet/provider/user/ldap.rb index 3a91b4f92..406ed0f93 100644 --- a/lib/puppet/provider/user/ldap.rb +++ b/lib/puppet/provider/user/ldap.rb @@ -70,10 +70,10 @@ Puppet::Type.type(:user).provide :ldap, :parent => Puppet::Provider::Ldap do def groups=(values) should = values.split(",") - if groups() == :absent + if groups == :absent is = [] else - is = groups().split(",") + is = groups.split(",") end modes = {} diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb index b2cdd2a2b..33b1bc122 100644 --- a/lib/puppet/provider/zone/solaris.rb +++ b/lib/puppet/provider/zone/solaris.rb @@ -89,7 +89,7 @@ Puppet::Type.type(:zone).provide(:solaris) do # We need a way to test whether a zone is in process. Our 'ensure' # property models the static states, but we need to handle the temporary ones. def processing? - if hash = status() + if hash = status case hash[:ensure] when "incomplete", "ready", "shutting_down" true @@ -212,7 +212,7 @@ Puppet::Type.type(:zone).provide(:solaris) do # Turn the results of getconfig into status information. def config_status - config = getconfig() + config = getconfig result = {} result[:autoboot] = config[:autoboot] ? config[:autoboot].intern : :absent diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb index 43978ab39..f1d97bf4f 100644 --- a/lib/puppet/rails.rb +++ b/lib/puppet/rails.rb @@ -78,14 +78,14 @@ module Puppet::Rails def self.init raise Puppet::DevError, "No activerecord, cannot init Puppet::Rails" unless Puppet.features.rails? - connect() + connect unless ActiveRecord::Base.connection.tables.include?("resources") require 'puppet/rails/database/schema' Puppet::Rails::Schema.init end - migrate() if Puppet[:dbmigrate] + migrate if Puppet[:dbmigrate] end # Migrate to the latest db schema. @@ -120,7 +120,7 @@ module Puppet::Rails Puppet.settings.use(:master, :rails) begin - ActiveRecord::Base.establish_connection(database_arguments()) + ActiveRecord::Base.establish_connection(database_arguments) rescue => detail puts detail.backtrace if Puppet[:trace] raise Puppet::Error, "Could not connect to database: #{detail}" diff --git a/lib/puppet/rails/host.rb b/lib/puppet/rails/host.rb index 854df2bd4..510790235 100644 --- a/lib/puppet/rails/host.rb +++ b/lib/puppet/rails/host.rb @@ -153,7 +153,7 @@ class Puppet::Rails::Host < ActiveRecord::Base resources_by_id = nil debug_benchmark("Searched for resources") { - resources_by_id = find_resources() + resources_by_id = find_resources } debug_benchmark("Searched for resource params and tags") { diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb index 46b49ba1b..f485909a3 100644 --- a/lib/puppet/rails/resource.rb +++ b/lib/puppet/rails/resource.rb @@ -92,7 +92,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base accumulate_benchmark("Individual resource merger", :attributes) { merge_attributes(resource) } accumulate_benchmark("Individual resource merger", :parameters) { merge_parameters(resource) } accumulate_benchmark("Individual resource merger", :tags) { merge_tags(resource) } - save() + save end def merge_attributes(resource) @@ -170,7 +170,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base end def name - ref() + ref end def parameter(param) diff --git a/lib/puppet/reports/rrdgraph.rb b/lib/puppet/reports/rrdgraph.rb index b152faaab..2f27f63af 100644 --- a/lib/puppet/reports/rrdgraph.rb +++ b/lib/puppet/reports/rrdgraph.rb @@ -115,7 +115,7 @@ Puppet::Reports.register_report(:rrdgraph) do metric.graph end - mkhtml() unless FileTest.exists?(File.join(hostdir, "index.html")) + mkhtml unless FileTest.exists?(File.join(hostdir, "index.html")) end # Unfortunately, RRD does not deal well with changing lists of values, diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb index 88f85c3ad..cc84b7663 100644 --- a/lib/puppet/resource.rb +++ b/lib/puppet/resource.rb @@ -169,7 +169,7 @@ class Puppet::Resource extract_parameters(params) end - resolve_type_and_title() + resolve_type_and_title tag(self.type) tag(self.title) if valid_tag?(self.title) @@ -360,7 +360,7 @@ class Puppet::Resource # Produce a canonical method name. def parameter_name(param) param = param.to_s.downcase.to_sym - if param == :name and n = namevar() + if param == :name and n = namevar param = namevar end param diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb index b5f173718..79888529f 100644 --- a/lib/puppet/resource/catalog.rb +++ b/lib/puppet/resource/catalog.rb @@ -129,7 +129,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph # Expire all of the resource data -- this ensures that all # data we're operating against is entirely current. - expire() + expire Puppet::Util::Storage.load if host_config? transaction = Puppet::Transaction.new(self) @@ -159,7 +159,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph return transaction ensure @applying = false - cleanup() + cleanup end # Are we in the middle of applying the catalog? @@ -283,7 +283,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph if block_given? yield(self) - finalize() + finalize end end @@ -497,7 +497,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph def cleanup # Expire any cached data the resources are keeping. - expire() + expire end # Verify that the given resource isn't defined elsewhere. diff --git a/lib/puppet/run.rb b/lib/puppet/run.rb index 028545961..658b9677f 100644 --- a/lib/puppet/run.rb +++ b/lib/puppet/run.rb @@ -49,7 +49,7 @@ class Puppet::Run return self end - log_run() + log_run if background? Thread.new { agent.run(options) } diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb index c8ffef529..172a0f7b5 100644 --- a/lib/puppet/simple_graph.rb +++ b/lib/puppet/simple_graph.rb @@ -300,7 +300,7 @@ class Puppet::SimpleGraph # # For some reason, unconnected vertices do not show up in # # this graph. # def to_jpg(path, name) -# gv = vertices() +# gv = vertices # Dir.chdir(path) do # induced_subgraph(gv).write_to_graphic_file('jpg', name) # end diff --git a/lib/puppet/ssl/certificate_authority.rb b/lib/puppet/ssl/certificate_authority.rb index be74c2fac..26febb3d3 100644 --- a/lib/puppet/ssl/certificate_authority.rb +++ b/lib/puppet/ssl/certificate_authority.rb @@ -133,7 +133,7 @@ class Puppet::SSL::CertificateAuthority @certificate = sign(host.name, :ca, request) # And make sure we initialize our CRL. - crl() + crl end def initialize @@ -143,7 +143,7 @@ class Puppet::SSL::CertificateAuthority @host = Puppet::SSL::Host.new(Puppet::SSL::Host.ca_name) - setup() + setup end # Retrieve (or create, if necessary) our inventory manager. diff --git a/lib/puppet/ssl/certificate_factory.rb b/lib/puppet/ssl/certificate_factory.rb index e794c770c..9a5507dea 100644 --- a/lib/puppet/ssl/certificate_factory.rb +++ b/lib/puppet/ssl/certificate_factory.rb @@ -29,7 +29,7 @@ class Puppet::SSL::CertificateFactory @cert.public_key = @csr.public_key @cert.serial = @serial - build_extensions() + build_extensions set_ttl diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb index ae91ceafb..9aaff8ad2 100644 --- a/lib/puppet/ssl/host.rb +++ b/lib/puppet/ssl/host.rb @@ -24,7 +24,7 @@ class Puppet::SSL::Host include Puppet::Util::Cacher cached_attr(:localhost) do - result = new() + result = new result.generate unless result.certificate result.key # Make sure it's read in result @@ -184,7 +184,7 @@ class Puppet::SSL::Host # If we can get a CA instance, then we're a valid CA, and we # should use it to sign our request; else, just try to read # the cert. - if ! certificate() and ca = Puppet::SSL::CertificateAuthority.instance + if ! certificate and ca = Puppet::SSL::CertificateAuthority.instance ca.sign(self.name) end end diff --git a/lib/puppet/sslcertificates/certificate.rb b/lib/puppet/sslcertificates/certificate.rb index 92a2a7c88..a9d1dd4ea 100644 --- a/lib/puppet/sslcertificates/certificate.rb +++ b/lib/puppet/sslcertificates/certificate.rb @@ -33,7 +33,7 @@ class Puppet::SSLCertificates::Certificate end def getkey - self.mkkey() unless FileTest.exists?(@keyfile) + self.mkkey unless FileTest.exists?(@keyfile) if @password @key = OpenSSL::PKey::RSA.new( diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index 15ce5903b..d70e06c85 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -127,7 +127,7 @@ class Puppet::Transaction # Start logging. Puppet::Util::Log.newdestination(@report) - prepare() + prepare Puppet.info "Applying configuration version '#{catalog.version}'" if catalog.version @@ -271,11 +271,11 @@ class Puppet::Transaction # Prepare to evaluate the resources in a transaction. def prepare # Now add any dynamically generated resources - generate() + generate # Then prefetch. It's important that we generate and then prefetch, # so that any generated resources also get prefetched. - prefetch() + prefetch # This will throw an error if there are cycles in the graph. @sorted_resources = relationship_graph.topsort @@ -288,7 +288,7 @@ class Puppet::Transaction # Send off the transaction report. def send_report begin - report = generate_report() + report = generate_report rescue => detail Puppet.err "Could not generate report: #{detail}" return @@ -298,7 +298,7 @@ class Puppet::Transaction if Puppet[:report] begin - report.save() + report.save rescue => detail Puppet.err "Reporting failed: #{detail}" end diff --git a/lib/puppet/transaction/change.rb b/lib/puppet/transaction/change.rb index 0f2ed5788..c8acec88b 100644 --- a/lib/puppet/transaction/change.rb +++ b/lib/puppet/transaction/change.rb @@ -33,14 +33,14 @@ class Puppet::Transaction::Change property.sync - result = event() + result = event result.message = property.change_to_s(is, should) result.status = "success" result.send_log result rescue => detail puts detail.backtrace if Puppet[:trace] - result = event() + result = event result.status = "failure" result.message = "change from #{property.is_to_s(is)} to #{property.should_to_s(should)} failed: #{detail}" diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 7aab88c9c..1e0bde5e7 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -35,7 +35,7 @@ class Type def self.states warnonce "The states method is deprecated; use properties" - properties() + properties end # All parameters, in the appropriate order. The key_attributes come first, then @@ -435,8 +435,8 @@ class Type # iterate across the existing properties def eachproperty - # properties() is a private method - properties().each { |property| + # properties is a private method + properties.each { |property| yield property } end @@ -706,7 +706,7 @@ class Type # is the first property, which is important for skipping 'retrieve' on # all the properties if the resource is absent. ensure_state = false - return properties().inject({}) do | prophash, property| + return properties.inject({}) do | prophash, property| if property.name == :ensure ensure_state = property.retrieve prophash[property] = ensure_state @@ -979,7 +979,7 @@ class Type def properties_to_audit(list) if list == :all - list = all_properties() if list == :all + list = all_properties if list == :all else list = Array(list).collect { |p| p.to_sym } end @@ -1329,7 +1329,7 @@ class Type # Find the default provider. def self.defaultprovider unless @defaultprovider - suitable = suitableprovider() + suitable = suitableprovider # Find which providers are a default for this system. defaults = suitable.find_all { |provider| provider.default? } @@ -1450,7 +1450,7 @@ class Type # We need to add documentation for each provider. def self.doc - @doc + " Available providers are:\n\n" + parenttype().providers.sort { |a,b| + @doc + " Available providers are:\n\n" + parenttype.providers.sort { |a,b| a.to_s <=> b.to_s }.collect { |i| "* **#{i}**: #{parenttype().provider(i).doc}" @@ -1684,7 +1684,7 @@ class Type # instance methods related to instance intrinsics - # e.g., initialize() and name() + # e.g., initialize and name public @@ -1880,7 +1880,7 @@ class Type end end -end # Puppet::Type +end end require 'puppet/provider' diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb index ae8f1a525..5a6fb54de 100644 --- a/lib/puppet/type/augeas.rb +++ b/lib/puppet/type/augeas.rb @@ -176,7 +176,7 @@ Puppet::Type.newtype(:augeas) do # Actually execute the command. def sync - @resource.provider.execute_changes() + @resource.provider.execute_changes end end diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb index 7a1f37f1d..5a2533289 100755 --- a/lib/puppet/type/cron.rb +++ b/lib/puppet/type/cron.rb @@ -181,7 +181,7 @@ Puppet::Type.newtype(:cron) do # If it has an alpha method defined, then we check # to see if our value is in that list and if so we turn # it into a number - retval = alphacheck(value, alpha()) + retval = alphacheck(value, alpha) end if retval @@ -237,7 +237,7 @@ Puppet::Type.newtype(:cron) do end validate do |value| - raise ArgumentError, "Invalid special schedule #{value.inspect}" unless specials().include?(value) + raise ArgumentError, "Invalid special schedule #{value.inspect}" unless specials.include?(value) end end diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index f930a536c..a60cdb481 100755 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -530,7 +530,7 @@ module Puppet # Verify that we pass all of the checks. The argument determines whether # we skip the :refreshonly check, which is necessary because we now check - # within refresh() + # within refresh def check(refreshing = false) self.class.checks.each { |check| next if refreshing and check == :refreshonly diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 0f1f5d81b..afa990d7f 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -365,7 +365,7 @@ Puppet::Type.newtype(:file) do # there is one. def finish # Look up our bucket, if there is one - bucket() + bucket super end diff --git a/lib/puppet/type/file/target.rb b/lib/puppet/type/file/target.rb index ab7b847a7..59f1e5972 100644 --- a/lib/puppet/type/file/target.rb +++ b/lib/puppet/type/file/target.rb @@ -12,9 +12,9 @@ module Puppet newvalue(/./) do @resource[:ensure] = :link if ! @resource.should(:ensure) - # Only call mklink if ensure() didn't call us in the first place. + # Only call mklink if ensure didn't call us in the first place. currentensure = @resource.property(:ensure).retrieve - mklink() if @resource.property(:ensure).insync?(currentensure) + mklink if @resource.property(:ensure).insync?(currentensure) end # Create our link. @@ -30,7 +30,7 @@ module Puppet raise Puppet::Error, "Could not remove existing file" if FileTest.exists?(@resource[:path]) Dir.chdir(File.dirname(@resource[:path])) do - Puppet::Util::SUIDManager.asuser(@resource.asuser()) do + Puppet::Util::SUIDManager.asuser(@resource.asuser) do mode = @resource.should(:mode) if mode Puppet::Util.withumask(000) do diff --git a/lib/puppet/type/filebucket.rb b/lib/puppet/type/filebucket.rb index cc3474b40..37ebd2d61 100755 --- a/lib/puppet/type/filebucket.rb +++ b/lib/puppet/type/filebucket.rb @@ -61,7 +61,7 @@ module Puppet end def bucket - mkbucket() unless defined?(@bucket) + mkbucket unless defined?(@bucket) @bucket end diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb index 5772e44a1..cf9b40867 100755 --- a/lib/puppet/type/mount.rb +++ b/lib/puppet/type/mount.rb @@ -12,7 +12,7 @@ module Puppet :methods => [:remount] # Use the normal parent class, because we actually want to - # call code when sync() is called. + # call code when sync is called. newproperty(:ensure) do desc "Control what to do with this mount. Set this attribute to ``umounted`` to make sure the filesystem is in the filesystem table @@ -30,7 +30,7 @@ module Puppet newvalue(:unmounted) do if provider.mounted? - syncothers() + syncothers provider.unmount return :mount_unmounted else @@ -50,7 +50,7 @@ module Puppet current_value = self.retrieve provider.create if current_value.nil? or current_value == :absent - syncothers() + syncothers # The fs can be already mounted if it was absent but mounted provider.mount unless provider.mounted? diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index e1a23dd13..658901ee2 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -318,6 +318,6 @@ module Puppet def exists? @provider.get(:ensure) != :absent end - end # Puppet::Type.type(:package) + end end diff --git a/lib/puppet/type/resources.rb b/lib/puppet/type/resources.rb index 76685d6bd..6e351f861 100644 --- a/lib/puppet/type/resources.rb +++ b/lib/puppet/type/resources.rb @@ -123,7 +123,7 @@ Puppet::Type.newtype(:resources) do resource[:audit] = :uid current_values = resource.retrieve_resource - return false if system_users().include?(resource[:name]) + return false if system_users.include?(resource[:name]) current_values[resource.property(:uid)] > self[:unless_system_user] end diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index 9e5afe083..4c472275c 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -248,7 +248,7 @@ module Puppet def retrieve absent = false - properties().inject({}) { |prophash, property| + properties.inject({}) { |prophash, property| current_value = :absent if absent diff --git a/lib/puppet/type/yumrepo.rb b/lib/puppet/type/yumrepo.rb index b85bc5994..d37da0291 100644 --- a/lib/puppet/type/yumrepo.rb +++ b/lib/puppet/type/yumrepo.rb @@ -103,7 +103,7 @@ module Puppet # Return the Puppet::Util::IniConfig::File for the whole yum config def self.inifile if @inifile.nil? - @inifile = read() + @inifile = read main = @inifile['main'] raise Puppet::Error, "File #{yumconf} does not contain a main section" if main.nil? reposdir = main['reposdir'] @@ -128,7 +128,7 @@ module Puppet # Non-test code should use self.inifile to get at the # underlying file def self.read - result = Puppet::Util::IniConfig::File.new() + result = Puppet::Util::IniConfig::File.new result.read(yumconf) main = result['main'] raise Puppet::Error, "File #{yumconf} does not contain a main section" if main.nil? diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb index a60706bb8..9d972a17a 100644 --- a/lib/puppet/type/zone.rb +++ b/lib/puppet/type/zone.rb @@ -412,12 +412,12 @@ Puppet::Type.newtype(:zone) do def retrieve provider.flush - if hash = provider.properties() and hash[:ensure] != :absent + if hash = provider.properties and hash[:ensure] != :absent result = setstatus(hash) result else # Return all properties as absent. - return properties().inject({}) do | prophash, property| + return properties.inject({}) do | prophash, property| prophash[property] = :absent prophash end diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index a950aa562..221365a03 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -301,14 +301,14 @@ module Util rescue => detail puts detail.to_s exit!(1) - end # begin; rescue - end # if child_pid + end + end elsif Puppet.features.microsoft_windows? command = command.collect {|part| '"' + part.gsub(/"/, '\\"') + '"'}.join(" ") if command.is_a?(Array) 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 + end # read output in if required if ! arguments[:squelch] diff --git a/lib/puppet/util/checksums.rb b/lib/puppet/util/checksums.rb index a05cc0e4f..102ee98ac 100644 --- a/lib/puppet/util/checksums.rb +++ b/lib/puppet/util/checksums.rb @@ -31,7 +31,7 @@ module Puppet::Util::Checksums def md5_file(filename, lite = false) require 'digest/md5' - digest = Digest::MD5.new() + digest = Digest::MD5.new checksum_file(digest, filename, lite) end @@ -42,7 +42,7 @@ module Puppet::Util::Checksums def md5_stream(&block) require 'digest/md5' - digest = Digest::MD5.new() + digest = Digest::MD5.new yield digest digest.hexdigest end @@ -76,7 +76,7 @@ module Puppet::Util::Checksums def sha1_file(filename, lite = false) require 'digest/sha1' - digest = Digest::SHA1.new() + digest = Digest::SHA1.new checksum_file(digest, filename, lite) end @@ -87,7 +87,7 @@ module Puppet::Util::Checksums def sha1_stream require 'digest/sha1' - digest = Digest::SHA1.new() + digest = Digest::SHA1.new yield digest digest.hexdigest end diff --git a/lib/puppet/util/docs.rb b/lib/puppet/util/docs.rb index d247ec044..dc742d4b0 100644 --- a/lib/puppet/util/docs.rb +++ b/lib/puppet/util/docs.rb @@ -90,8 +90,8 @@ module Puppet::Util::Docs # If we can match an indentation, then just remove that same level of # indent from every line. However, ignore any indentation on the # first line, since that can be inconsistent. - text = text.lstrip() - text.gsub!(/^([\t]+)/) { |s| " "*8*s.length(); } # Expand leading tabs + text = text.lstrip + text.gsub!(/^([\t]+)/) { |s| " "*8*s.length; } # Expand leading tabs # Find first non-empty line after the first line: line2start = (text =~ /(\n?\s*\n)/) line2start += $1.length diff --git a/lib/puppet/util/filetype.rb b/lib/puppet/util/filetype.rb index 554ac0566..bacc7d2b6 100755 --- a/lib/puppet/util/filetype.rb +++ b/lib/puppet/util/filetype.rb @@ -34,7 +34,7 @@ class Puppet::Util::FileType define_method(:real_read, instance_method(:read)) define_method(:read) do begin - val = real_read() + val = real_read @loaded = Time.now if val return val.gsub(/# HEADER.*\n/,'') @@ -165,15 +165,15 @@ class Puppet::Util::FileType # Read a specific @path's cron tab. def read - %x{#{cmdbase()} -l 2>/dev/null} + %x{#{cmdbase} -l 2>/dev/null} end # Remove a specific @path's cron tab. def remove if %w{Darwin FreeBSD}.include?(Facter.value("operatingsystem")) - %x{/bin/echo yes | #{cmdbase()} -r 2>/dev/null} + %x{/bin/echo yes | #{cmdbase} -r 2>/dev/null} else - %x{#{cmdbase()} -r 2>/dev/null} + %x{#{cmdbase} -r 2>/dev/null} end end diff --git a/lib/puppet/util/ldap/manager.rb b/lib/puppet/util/ldap/manager.rb index 3e3c54562..501a3cd4a 100644 --- a/lib/puppet/util/ldap/manager.rb +++ b/lib/puppet/util/ldap/manager.rb @@ -200,7 +200,7 @@ class Puppet::Util::Ldap::Manager # Search for all entries at our base. A potentially expensive search. def search(sfilter = nil) - sfilter ||= filter() + sfilter ||= filter result = [] connect do |conn| diff --git a/lib/puppet/util/loadedfile.rb b/lib/puppet/util/loadedfile.rb index 22d8928e7..9eaca552b 100755 --- a/lib/puppet/util/loadedfile.rb +++ b/lib/puppet/util/loadedfile.rb @@ -17,12 +17,12 @@ module Puppet def changed? # Allow the timeout to be disabled entirely. return true if Puppet[:filetimeout] < 0 - tmp = stamp() + tmp = stamp # We use a different internal variable than the stamp method # because it doesn't keep historical state and we do -- that is, # we will always be comparing two timestamps, whereas - # stamp() just always wants the latest one. + # stamp just always wants the latest one. if tmp == @tstamp return false else @@ -40,7 +40,7 @@ module Puppet end @statted = 0 @stamp = nil - @tstamp = stamp() + @tstamp = stamp end # Retrieve the filestamp, but only refresh it if we're beyond our diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb index e841c7add..c47aa0d6f 100644 --- a/lib/puppet/util/log.rb +++ b/lib/puppet/util/log.rb @@ -118,7 +118,7 @@ class Puppet::Util::Log if type.instance_method(:initialize).arity == 1 @destinations[dest] = type.new(dest) else - @destinations[dest] = type.new() + @destinations[dest] = type.new end flushqueue @destinations[dest] diff --git a/lib/puppet/util/logging.rb b/lib/puppet/util/logging.rb index e514affd0..b4a531bfc 100644 --- a/lib/puppet/util/logging.rb +++ b/lib/puppet/util/logging.rb @@ -4,7 +4,7 @@ require 'puppet/util/log' module Puppet::Util::Logging def send_log(level, message) - Puppet::Util::Log.create({:level => level, :source => log_source(), :message => message}.merge(log_metadata)) + Puppet::Util::Log.create({:level => level, :source => log_source, :message => message}.merge(log_metadata)) end # Create a method for each log level. diff --git a/lib/puppet/util/queue.rb b/lib/puppet/util/queue.rb index 31425fbae..d09d32cec 100644 --- a/lib/puppet/util/queue.rb +++ b/lib/puppet/util/queue.rb @@ -29,7 +29,7 @@ require 'puppet/util/instance_loader' # +client+, which will return a class-wide singleton client instance, determined by +client_class+. # # The client plugins are expected to implement an interface similar to that of Stomp::Client: -# * <tt>new()</tt> should return a connected, ready-to-go client instance. Note that no arguments are passed in. +# * <tt>new</tt> should return a connected, ready-to-go client instance. Note that no arguments are passed in. # * <tt>send_message(queue, message)</tt> should send the _message_ to the specified _queue_. # * <tt>subscribe(queue)</tt> _block_ subscribes to _queue_ and executes _block_ upon receiving a message. # * _queue_ names are simple names independent of the message broker or client library. No "/queue/" prefixes like in Stomp::Client. diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb index 606d06cdd..b0ff98834 100644 --- a/lib/puppet/util/rdoc/parser.rb +++ b/lib/puppet/util/rdoc/parser.rb @@ -84,7 +84,7 @@ class Parser modpath = $1 name = $2 Puppet.debug "rdoc: module #{name} into #{modpath} ?" - Puppet::Module.modulepath().each do |mp| + Puppet::Module.modulepath.each do |mp| if File.identical?(modpath,mp) Puppet.debug "rdoc: found module #{name}" return name @@ -95,7 +95,7 @@ class Parser # there can be paths we don't want to scan under modules # imagine a ruby or manifest that would be distributed as part as a module # but we don't want those to be hosted under <site> - Puppet::Module.modulepath().each do |mp| + Puppet::Module.modulepath.each do |mp| # check that fullpath is a descendant of mp dirname = fullpath while (dirname = File.dirname(dirname)) != '/' diff --git a/lib/puppet/util/reference.rb b/lib/puppet/util/reference.rb index fb4b84f7c..78304217c 100644 --- a/lib/puppet/util/reference.rb +++ b/lib/puppet/util/reference.rb @@ -171,7 +171,7 @@ class Puppet::Util::Reference text += @header - text += generate() + text += generate text += self.class.footer if withcontents diff --git a/lib/puppet/util/resource_template.rb b/lib/puppet/util/resource_template.rb index 164d75ae3..ceb9ea389 100644 --- a/lib/puppet/util/resource_template.rb +++ b/lib/puppet/util/resource_template.rb @@ -8,7 +8,7 @@ require 'erb' # This provides functionality essentially equivalent to # the language's template() function. You pass your file # path and the resource you want to use into the initialization -# method, then call result() on the instance, and you get back +# method, then call result on the instance, and you get back # a chunk of text. # The resource's parameters are available as instance variables # (as opposed to the language, where we use a method_missing trick). diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index ab7e12d29..5aafd9c02 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -141,7 +141,7 @@ module Puppet::Util::SELinux mounts = "" begin if File.instance_methods.include? "read_nonblock" - # If possible we use read_nonblock() in a loop rather than read() to work- + # If possible we use read_nonblock in a loop rather than read to work- # a linux kernel bug. See ticket #1963 for details. mountfh = File.open("/proc/mounts") mounts += mountfh.read_nonblock(1024) while true @@ -184,7 +184,7 @@ module Puppet::Util::SELinux # Internal helper function to return which type of filesystem a # given file path resides on def find_fs(path) - unless mnts = read_mounts() + unless mnts = read_mounts return nil end diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index 80cab1976..5573145b5 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -308,7 +308,7 @@ class Puppet::Util::Settings # Create a timer so that this file will get checked automatically # and reparsed if necessary. - set_filetimeout_timer() + set_filetimeout_timer end # Unsafely parse the file -- this isn't thread-safe and causes plenty of problems if used directly. @@ -343,7 +343,7 @@ class Puppet::Util::Settings settings_with_hooks.each do |setting| each_source(env) do |source| if value = @values[source][setting.name] - # We still have to use value() to retrieve the value, since + # We still have to use value to retrieve the value, since # we want the fully interpolated value, not $vardir/lib or whatever. # This results in extra work, but so few of the settings # will have associated hooks that it ends up being less work this @@ -421,7 +421,7 @@ class Puppet::Util::Settings if file and file.changed? Puppet.notice "Reparsing #{file.file}" parse - reuse() + reuse end end @@ -557,7 +557,7 @@ class Puppet::Util::Settings # Create a timer to check whether the file should be reparsed. def set_filetimeout_timer return unless timeout = self[:filetimeout] and timeout = Integer(timeout) and timeout > 0 - timer = EventLoop::Timer.new(:interval => timeout, :tolerance => 1, :start? => true) { self.reparse() } + timer = EventLoop::Timer.new(:interval => timeout, :tolerance => 1, :start? => true) { self.reparse } end # Convert the settings we manage into a catalog full of resources that model those settings. @@ -688,7 +688,7 @@ if @config.include?(:run_mode) return nil unless @config.include?(param) # Yay, recursion. - #self.reparse() unless [:config, :filetimeout].include?(param) + #self.reparse unless [:config, :filetimeout].include?(param) # Check the cache first. It needs to be a per-environment # cache so that we don't spread values from one env diff --git a/lib/puppet/util/warnings.rb b/lib/puppet/util/warnings.rb index 3156b412c..355010842 100644 --- a/lib/puppet/util/warnings.rb +++ b/lib/puppet/util/warnings.rb @@ -11,7 +11,7 @@ module Puppet::Util::Warnings Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.warning msg } end - def clear_warnings() + def clear_warnings @stampwarnings = {} nil end diff --git a/lib/puppet/util/zaml.rb b/lib/puppet/util/zaml.rb index 88c660cac..aff837077 100644 --- a/lib/puppet/util/zaml.rb +++ b/lib/puppet/util/zaml.rb @@ -1,7 +1,7 @@ # # ZAML -- A partial replacement for YAML, writen with speed and code clarity # in mind. ZAML fixes one YAML bug (loading Exceptions) and provides -# a replacement for YAML.dump() unimaginatively called ZAML.dump(), +# a replacement for YAML.dump unimaginatively called ZAML.dump, # which is faster on all known cases and an order of magnitude faster # with complex structures. # |