diff options
author | Markus Roberts <Markus@reality.com> | 2010-07-09 18:06:33 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-09 18:06:33 -0700 |
commit | 8d1fbe4586c91682cdda0cb271649e918fd9778b (patch) | |
tree | 314508ca21830874d9e4ec6e27880fede14193bd | |
parent | 889158ad57e33df083613d6f7d136b2e11aaa16a (diff) | |
download | puppet-8d1fbe4586c91682cdda0cb271649e918fd9778b.tar.gz puppet-8d1fbe4586c91682cdda0cb271649e918fd9778b.tar.xz puppet-8d1fbe4586c91682cdda0cb271649e918fd9778b.zip |
Code smell: Avoid explicit returns
Replaced 583 occurances of
(DEF)
(LINES)
return (.*)
end
with
3 Examples:
The code:
def consolidate_failures(failed)
filters = Hash.new { |h,k| h[k] = [] }
failed.each do |spec, failed_trace|
if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) }
filters[f] << spec
break
end
end
return filters
end
becomes:
def consolidate_failures(failed)
filters = Hash.new { |h,k| h[k] = [] }
failed.each do |spec, failed_trace|
if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) }
filters[f] << spec
break
end
end
filters
end
The code:
def retrieve
return_value = super
return_value = return_value[0] if return_value && return_value.is_a?(Array)
return return_value
end
becomes:
def retrieve
return_value = super
return_value = return_value[0] if return_value && return_value.is_a?(Array)
return_value
end
The code:
def fake_fstab
os = Facter['operatingsystem']
if os == "Solaris"
name = "solaris.fstab"
elsif os == "FreeBSD"
name = "freebsd.fstab"
else
# Catchall for other fstabs
name = "linux.fstab"
end
oldpath = @provider_class.default_target
return fakefile(File::join("data/types/mount", name))
end
becomes:
def fake_fstab
os = Facter['operatingsystem']
if os == "Solaris"
name = "solaris.fstab"
elsif os == "FreeBSD"
name = "freebsd.fstab"
else
# Catchall for other fstabs
name = "linux.fstab"
end
oldpath = @provider_class.default_target
fakefile(File::join("data/types/mount", name))
end
256 files changed, 583 insertions, 583 deletions
diff --git a/autotest/rspec.rb b/autotest/rspec.rb index 42f4c004b..0c6334d56 100644 --- a/autotest/rspec.rb +++ b/autotest/rspec.rb @@ -34,11 +34,11 @@ class Autotest::Rspec < Autotest break end end - return filters + filters end def make_test_cmd(files_to_test) - return "#{ruby} -S #{spec_command} #{add_options_if_present} #{files_to_test.keys.flatten.join(' ')}" + "#{ruby} -S #{spec_command} #{add_options_if_present} #{files_to_test.keys.flatten.join(' ')}" end def add_options_if_present diff --git a/lib/puppet.rb b/lib/puppet.rb index 2f036e23e..dc14c8716 100644 --- a/lib/puppet.rb +++ b/lib/puppet.rb @@ -27,7 +27,7 @@ module Puppet PUPPETVERSION = '2.6.0' def Puppet.version - return PUPPETVERSION + PUPPETVERSION end class << self diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb index 24f78e8dd..1a9939b76 100644 --- a/lib/puppet/application.rb +++ b/lib/puppet/application.rb @@ -183,7 +183,7 @@ class Application def should_parse_config? @parse_config = true if ! defined?(@parse_config) - return @parse_config + @parse_config end # used to declare code that handle an option diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb index 43ee683f6..2d7ac1b6a 100644 --- a/lib/puppet/application/agent.rb +++ b/lib/puppet/application/agent.rb @@ -93,7 +93,7 @@ class Puppet::Application::Agent < Puppet::Application def run_command return fingerprint if options[:fingerprint] return onetime if Puppet[:onetime] - return main + main end def fingerprint diff --git a/lib/puppet/application/describe.rb b/lib/puppet/application/describe.rb index f2621d354..64246d1ea 100644 --- a/lib/puppet/application/describe.rb +++ b/lib/puppet/application/describe.rb @@ -25,7 +25,7 @@ class Formatter end end res << work if work.length.nonzero? - return prefix + res.join("\n#{prefix}") + prefix + res.join("\n#{prefix}") end def header(txt, sep = "-") diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index 2b5e3f98a..634602c1a 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -120,7 +120,7 @@ class Puppet::Configurer catalog.finalize catalog.retrieval_duration = duration catalog.write_class_file - return catalog + catalog end # The code that actually runs the catalog. @@ -195,7 +195,7 @@ class Puppet::Configurer raise ArgumentError, "Configuration timeout must be an integer" end - return timeout + timeout end def execute_from_setting(setting) diff --git a/lib/puppet/configurer/downloader.rb b/lib/puppet/configurer/downloader.rb index 5daea295b..8f8dda58c 100644 --- a/lib/puppet/configurer/downloader.rb +++ b/lib/puppet/configurer/downloader.rb @@ -19,7 +19,7 @@ class Puppet::Configurer::Downloader raise ArgumentError, "Configuration timeout must be an integer" end - return timeout + timeout end # Evaluate our download, returning the list of changed values. @@ -41,7 +41,7 @@ class Puppet::Configurer::Downloader Puppet.err "Could not retrieve #{name}: #{detail}" end - return files + files end def initialize(name, path, source, ignore = nil) diff --git a/lib/puppet/configurer/fact_handler.rb b/lib/puppet/configurer/fact_handler.rb index 9710681d4..74bea1998 100644 --- a/lib/puppet/configurer/fact_handler.rb +++ b/lib/puppet/configurer/fact_handler.rb @@ -37,7 +37,7 @@ module Puppet::Configurer::FactHandler text = facts.render(format) - return {:facts_format => format, :facts => CGI.escape(text)} + {:facts_format => format, :facts => CGI.escape(text)} end # Retrieve facts from the central server. diff --git a/lib/puppet/dsl/resource_api.rb b/lib/puppet/dsl/resource_api.rb index 71230d1ad..3e56a5543 100644 --- a/lib/puppet/dsl/resource_api.rb +++ b/lib/puppet/dsl/resource_api.rb @@ -107,7 +107,7 @@ class Puppet::DSL::ResourceAPI end def map_function(name) - return FUNCTION_MAP[name] || name + FUNCTION_MAP[name] || name end def searching_for_method? diff --git a/lib/puppet/error.rb b/lib/puppet/error.rb index 040a6c4b2..7be84d573 100644 --- a/lib/puppet/error.rb +++ b/lib/puppet/error.rb @@ -32,7 +32,7 @@ module Puppet # :nodoc: str = @message.to_s end - return str + str end end diff --git a/lib/puppet/external/event-loop/signal-system.rb b/lib/puppet/external/event-loop/signal-system.rb index 0ea3552f2..09498c9f4 100644 --- a/lib/puppet/external/event-loop/signal-system.rb +++ b/lib/puppet/external/event-loop/signal-system.rb @@ -76,7 +76,7 @@ module SignalEmitter def add_signal_handler (name, &handler) __maybe_initialize_signal_emitter @signal_handlers[name] << handler - return handler + handler end define_soft_aliases [:on, :on_signal] => :add_signal_handler diff --git a/lib/puppet/external/nagios.rb b/lib/puppet/external/nagios.rb index d7f64d59b..2dd040dba 100755 --- a/lib/puppet/external/nagios.rb +++ b/lib/puppet/external/nagios.rb @@ -38,7 +38,7 @@ module Nagios } } parser = Nagios::Parser.new - return parser.parse(text) + parser.parse(text) end def Config.each diff --git a/lib/puppet/external/nagios/base.rb b/lib/puppet/external/nagios/base.rb index 9ffac4391..b526a805a 100755 --- a/lib/puppet/external/nagios/base.rb +++ b/lib/puppet/external/nagios/base.rb @@ -129,7 +129,7 @@ class Nagios::Base # Is the specified name a valid parameter? def self.parameter?(name) name = name.intern if name.is_a? String - return @parameters.include?(name) + @parameters.include?(name) end # Manually set the namevar @@ -237,7 +237,7 @@ class Nagios::Base end def namevar - return (self.type + "_name").intern + (self.type + "_name").intern end def parammap(param) diff --git a/lib/puppet/file_bucket/dipper.rb b/lib/puppet/file_bucket/dipper.rb index 73b2035d1..08192aa89 100644 --- a/lib/puppet/file_bucket/dipper.rb +++ b/lib/puppet/file_bucket/dipper.rb @@ -50,7 +50,7 @@ class Puppet::FileBucket::Dipper file_bucket_file = Puppet::FileBucket::File.find(source_path, :bucket_path => @local_path) raise Puppet::Error, "File not found" unless file_bucket_file - return file_bucket_file.to_s + file_bucket_file.to_s end # Restore the file diff --git a/lib/puppet/file_serving/configuration/parser.rb b/lib/puppet/file_serving/configuration/parser.rb index 79fb0314d..b86ff1ac9 100644 --- a/lib/puppet/file_serving/configuration/parser.rb +++ b/lib/puppet/file_serving/configuration/parser.rb @@ -46,7 +46,7 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile validate() - return @mounts + @mounts end private @@ -97,7 +97,7 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile mount = Mount::File.new(name) end @mounts[name] = mount - return mount + mount end # Set the path for a mount. diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb index dbfe46631..99bd8407c 100644 --- a/lib/puppet/file_serving/fileset.rb +++ b/lib/puppet/file_serving/fileset.rb @@ -153,7 +153,7 @@ class Puppet::FileServing::Fileset end end - return result + result end public # Stat a given file, using the links-appropriate method. diff --git a/lib/puppet/file_serving/indirection_hooks.rb b/lib/puppet/file_serving/indirection_hooks.rb index d1219f0c1..f6f7d6664 100644 --- a/lib/puppet/file_serving/indirection_hooks.rb +++ b/lib/puppet/file_serving/indirection_hooks.rb @@ -29,6 +29,6 @@ module Puppet::FileServing::IndirectionHooks end # If we're still here, we're using the file_server or modules. - return :file_server + :file_server end end diff --git a/lib/puppet/file_serving/metadata.rb b/lib/puppet/file_serving/metadata.rb index 697de1055..87d3f138e 100644 --- a/lib/puppet/file_serving/metadata.rb +++ b/lib/puppet/file_serving/metadata.rb @@ -32,7 +32,7 @@ class Puppet::FileServing::Metadata < Puppet::FileServing::Base desc << checksum desc << @destination rescue nil if ftype == 'link' - return desc.join("\t") + desc.join("\t") end def checksum_type=(type) diff --git a/lib/puppet/file_serving/mount/file.rb b/lib/puppet/file_serving/mount/file.rb index 89d8c0587..d934d1d10 100644 --- a/lib/puppet/file_serving/mount/file.rb +++ b/lib/puppet/file_serving/mount/file.rb @@ -30,7 +30,7 @@ class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount return nil end - return file + file end # Return an instance of the appropriate class. @@ -64,7 +64,7 @@ class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount def search(path, request) return nil unless path = complete_path(path, request.node) - return [path] + [path] end # Verify our configuration is valid. This should really check to diff --git a/lib/puppet/file_serving/mount/modules.rb b/lib/puppet/file_serving/mount/modules.rb index a7b6d9eee..e5fe56661 100644 --- a/lib/puppet/file_serving/mount/modules.rb +++ b/lib/puppet/file_serving/mount/modules.rb @@ -16,7 +16,7 @@ class Puppet::FileServing::Mount::Modules < Puppet::FileServing::Mount return nil unless mod = request.environment.module(module_name) return nil unless path = mod.file(relative_path) - return [path] + [path] end def valid? diff --git a/lib/puppet/file_serving/mount/plugins.rb b/lib/puppet/file_serving/mount/plugins.rb index 481542952..5e9e49ab2 100644 --- a/lib/puppet/file_serving/mount/plugins.rb +++ b/lib/puppet/file_serving/mount/plugins.rb @@ -10,7 +10,7 @@ class Puppet::FileServing::Mount::Plugins < Puppet::FileServing::Mount path = mod.plugin(relative_path) - return path + path end def search(relative_path, request) diff --git a/lib/puppet/indirector/catalog/compiler.rb b/lib/puppet/indirector/catalog/compiler.rb index c990456e3..4ceb25a97 100644 --- a/lib/puppet/indirector/catalog/compiler.rb +++ b/lib/puppet/indirector/catalog/compiler.rb @@ -81,7 +81,7 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code end end - return config + config end # Turn our host name into a node object. diff --git a/lib/puppet/indirector/couch.rb b/lib/puppet/indirector/couch.rb index 6818ee834..417d6f977 100644 --- a/lib/puppet/indirector/couch.rb +++ b/lib/puppet/indirector/couch.rb @@ -37,7 +37,7 @@ class Puppet::Indirector::Couch < Puppet::Indirector::Terminus return unless doc doc.merge!(hash_from(request)) doc.save - return true + true end def create(request) diff --git a/lib/puppet/indirector/direct_file_server.rb b/lib/puppet/indirector/direct_file_server.rb index f69f9e14b..ba5c7c435 100644 --- a/lib/puppet/indirector/direct_file_server.rb +++ b/lib/puppet/indirector/direct_file_server.rb @@ -13,7 +13,7 @@ class Puppet::Indirector::DirectFileServer < Puppet::Indirector::Terminus return nil unless FileTest.exists?(request.key) instance = model.new(request.key) instance.links = request.options[:links] if request.options[:links] - return instance + instance end def search(request) diff --git a/lib/puppet/indirector/exec.rb b/lib/puppet/indirector/exec.rb index cf09ed379..9d90d092d 100644 --- a/lib/puppet/indirector/exec.rb +++ b/lib/puppet/indirector/exec.rb @@ -10,7 +10,7 @@ class Puppet::Indirector::Exec < Puppet::Indirector::Terminus end # Translate the output to ruby. - return output + output end private diff --git a/lib/puppet/indirector/facts/facter.rb b/lib/puppet/indirector/facts/facter.rb index e1d910247..a3ce79b06 100644 --- a/lib/puppet/indirector/facts/facter.rb +++ b/lib/puppet/indirector/facts/facter.rb @@ -54,7 +54,7 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code raise ArgumentError, "Configuration timeout must be an integer" end - return timeout + timeout end def initialize(*args) diff --git a/lib/puppet/indirector/file_bucket_file/file.rb b/lib/puppet/indirector/file_bucket_file/file.rb index 34237b4ec..ed978695e 100644 --- a/lib/puppet/indirector/file_bucket_file/file.rb +++ b/lib/puppet/indirector/file_bucket_file/file.rb @@ -15,7 +15,7 @@ module Puppet::FileBucketFile def find( request ) checksum, path = request_to_checksum_and_path( request ) - return find_by_checksum( checksum, request.options ) + find_by_checksum( checksum, request.options ) end def save( request ) @@ -78,7 +78,7 @@ module Puppet::FileBucketFile end save_path_to_paths_file(bucket_file) - return bucket_file.checksum_data + bucket_file.checksum_data end def request_to_checksum_and_path( request ) @@ -96,7 +96,7 @@ module Puppet::FileBucketFile basedir = ::File.join(bucket_path, dir, digest) return basedir unless subfile - return ::File.join(basedir, subfile) + ::File.join(basedir, subfile) end def contents_path_for(bucket_file) diff --git a/lib/puppet/indirector/file_metadata/file.rb b/lib/puppet/indirector/file_metadata/file.rb index bb586489d..94047485f 100644 --- a/lib/puppet/indirector/file_metadata/file.rb +++ b/lib/puppet/indirector/file_metadata/file.rb @@ -13,7 +13,7 @@ class Puppet::Indirector::FileMetadata::File < Puppet::Indirector::DirectFileSer return unless data = super data.collect - return data + data end def search(request) @@ -21,6 +21,6 @@ class Puppet::Indirector::FileMetadata::File < Puppet::Indirector::DirectFileSer result.each { |instance| instance.collect } - return result + result end end diff --git a/lib/puppet/indirector/file_server.rb b/lib/puppet/indirector/file_server.rb index bf101d490..833fc6f82 100644 --- a/lib/puppet/indirector/file_server.rb +++ b/lib/puppet/indirector/file_server.rb @@ -19,7 +19,7 @@ class Puppet::Indirector::FileServer < Puppet::Indirector::Terminus # If we're not serving this mount, then access is denied. return false unless mount - return mount.allowed?(request.node, request.ip) + mount.allowed?(request.node, request.ip) end # Find our key using the fileserver. diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb index b7a6b8f1d..89235f356 100644 --- a/lib/puppet/indirector/indirection.rb +++ b/lib/puppet/indirector/indirection.rb @@ -121,7 +121,7 @@ class Puppet::Indirector::Indirection # Get the name of the terminus. raise Puppet::DevError, "No terminus specified for #{self.name}; cannot redirect" unless terminus_name ||= terminus_class - return termini[terminus_name] ||= make_terminus(terminus_name) + termini[terminus_name] ||= make_terminus(terminus_name) end # This can be used to select the terminus class. @@ -201,7 +201,7 @@ class Puppet::Indirector::Indirection return terminus.respond_to?(:filter) ? terminus.filter(result) : result end - return nil + nil end def find_in_cache(request) @@ -213,7 +213,7 @@ class Puppet::Indirector::Indirection end Puppet.debug "Using cached #{self.name} for #{request.key}" - return cached + cached end # Remove something via the terminus. @@ -292,7 +292,7 @@ class Puppet::Indirector::Indirection dest_terminus = terminus(terminus_name) check_authorization(request, dest_terminus) - return dest_terminus + dest_terminus end # Create a new terminus instance. @@ -301,7 +301,7 @@ class Puppet::Indirector::Indirection unless klass = Puppet::Indirector::Terminus.terminus_class(self.name, terminus_class) raise ArgumentError, "Could not find terminus #{terminus_class} for indirection #{self.name}" end - return klass.new + klass.new end # Cache our terminus instances indefinitely, but make it easy to clean them up. diff --git a/lib/puppet/indirector/ldap.rb b/lib/puppet/indirector/ldap.rb index 795aafa67..0b95b6ee0 100644 --- a/lib/puppet/indirector/ldap.rb +++ b/lib/puppet/indirector/ldap.rb @@ -4,7 +4,7 @@ require 'puppet/util/ldap/connection' class Puppet::Indirector::Ldap < Puppet::Indirector::Terminus # Perform our ldap search and process the result. def find(request) - return ldapsearch(search_filter(request.key)) { |entry| return process(entry) } || nil + ldapsearch(search_filter(request.key)) { |entry| return process(entry) } || nil end # Process the found entry. We assume that we don't just want the @@ -56,7 +56,7 @@ class Puppet::Indirector::Ldap < Puppet::Indirector::Terminus end end - return found + found end # Create an ldap connection. @@ -73,6 +73,6 @@ class Puppet::Indirector::Ldap < Puppet::Indirector::Terminus end end - return @connection + @connection end end diff --git a/lib/puppet/indirector/node/exec.rb b/lib/puppet/indirector/node/exec.rb index cac515f59..f458ba4c7 100644 --- a/lib/puppet/indirector/node/exec.rb +++ b/lib/puppet/indirector/node/exec.rb @@ -19,7 +19,7 @@ class Puppet::Node::Exec < Puppet::Indirector::Exec # Translate the output to ruby. result = translate(request.key, output) - return create_node(request.key, result) + create_node(request.key, result) end private @@ -36,7 +36,7 @@ class Puppet::Node::Exec < Puppet::Indirector::Exec end node.fact_merge - return node + node end # Translate the yaml string into Ruby objects. diff --git a/lib/puppet/indirector/node/ldap.rb b/lib/puppet/indirector/node/ldap.rb index 2ca44c3d6..c6f17d0bf 100644 --- a/lib/puppet/indirector/node/ldap.rb +++ b/lib/puppet/indirector/node/ldap.rb @@ -43,7 +43,7 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap end info = name2hash('default',name_env,'parent') - return info + info end # Look for our node in ldap. @@ -68,7 +68,7 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap end end - return node + node end # Find more than one node. LAK:NOTE This is a bit of a clumsy API, because the 'search' @@ -251,7 +251,7 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap parent = find_and_merge_parent(parent, info) end - return info + info end def get_classes_from_entry(entry) diff --git a/lib/puppet/indirector/resource/ral.rb b/lib/puppet/indirector/resource/ral.rb index d66c85622..7a97fcc58 100644 --- a/lib/puppet/indirector/resource/ral.rb +++ b/lib/puppet/indirector/resource/ral.rb @@ -4,7 +4,7 @@ class Puppet::Resource::Ral < Puppet::Indirector::Code res = type(request).instances.find { |o| o.name == resource_name(request) } res ||= type(request).new(:name => resource_name(request), :audit => type(request).properties.collect { |s| s.name }) - return res.to_resource + res.to_resource end def search( request ) @@ -29,7 +29,7 @@ class Puppet::Resource::Ral < Puppet::Indirector::Code catalog.add_resource ral_res catalog.apply - return ral_res.to_resource + ral_res.to_resource end private diff --git a/lib/puppet/indirector/rest.rb b/lib/puppet/indirector/rest.rb index 6061b533d..127eb7110 100644 --- a/lib/puppet/indirector/rest.rb +++ b/lib/puppet/indirector/rest.rb @@ -20,7 +20,7 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus end def self.server - return Puppet.settings[server_setting || :server] + Puppet.settings[server_setting || :server] end # Specify the setting that we should use to get the port. @@ -29,7 +29,7 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus end def self.port - return Puppet.settings[port_setting || :masterport].to_i + Puppet.settings[port_setting || :masterport].to_i end # Figure out the content type, turn that into a format, and use the format @@ -77,7 +77,7 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus unless result = deserialize(network(request).get(indirection2uri(request), headers), true) return [] end - return result + result end def destroy(request) diff --git a/lib/puppet/indirector/ssl_file.rb b/lib/puppet/indirector/ssl_file.rb index f8034a4a1..3aeff3a7a 100644 --- a/lib/puppet/indirector/ssl_file.rb +++ b/lib/puppet/indirector/ssl_file.rb @@ -146,7 +146,7 @@ class Puppet::Indirector::SslFile < Puppet::Indirector::Terminus Puppet.notice "Fixing case in #{full_file}; renaming to #{file}" File.rename(full_file, file) - return true + true end # Yield a filehandle set up appropriately, either with our settings doing diff --git a/lib/puppet/indirector/status/local.rb b/lib/puppet/indirector/status/local.rb index 377be89df..f9a7fc578 100644 --- a/lib/puppet/indirector/status/local.rb +++ b/lib/puppet/indirector/status/local.rb @@ -2,6 +2,6 @@ require 'puppet/indirector/status' class Puppet::Indirector::Status::Local < Puppet::Indirector::Code def find( *anything ) - return model.new + model.new end end diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb index 821cca924..a7883bcdd 100644 --- a/lib/puppet/module.rb +++ b/lib/puppet/module.rb @@ -186,7 +186,7 @@ class Puppet::Module def subpath(type) return File.join(path, type) unless type.to_s == "plugins" - return backward_compatible_plugins_dir + backward_compatible_plugins_dir end def backward_compatible_plugins_dir diff --git a/lib/puppet/network/authstore.rb b/lib/puppet/network/authstore.rb index 555a5df64..720145ed8 100755 --- a/lib/puppet/network/authstore.rb +++ b/lib/puppet/network/authstore.rb @@ -20,7 +20,7 @@ module Puppet store(:allow, pattern) end - return nil + nil end # Is a given combination of name and ip address allowed? If either input @@ -46,7 +46,7 @@ module Puppet end info "defaulting to no access for #{name}" - return false + false end # Deny a given pattern. @@ -97,7 +97,7 @@ module Puppet @declarations << Declaration.new(type, pattern) @declarations.sort! - return nil + nil end # A single declaration. Stores the info for a given declaration, diff --git a/lib/puppet/network/client/ca.rb b/lib/puppet/network/client/ca.rb index 1460e4d6e..ca5c7d5cd 100644 --- a/lib/puppet/network/client/ca.rb +++ b/lib/puppet/network/client/ca.rb @@ -50,7 +50,7 @@ class Puppet::Network::Client::CA < Puppet::Network::Client Puppet.settings.write(:hostcert) do |f| f.print cert end Puppet.settings.write(:localcacert) do |f| f.print cacert end - return @cert + @cert end end diff --git a/lib/puppet/network/format.rb b/lib/puppet/network/format.rb index 243671d1c..bdaee0fec 100644 --- a/lib/puppet/network/format.rb +++ b/lib/puppet/network/format.rb @@ -81,7 +81,7 @@ class Puppet::Network::Format return false unless required_method_present?(:render_method, klass, :instance) - return true + true end def supported?(klass) diff --git a/lib/puppet/network/format_handler.rb b/lib/puppet/network/format_handler.rb index c21979ea4..70e33a054 100644 --- a/lib/puppet/network/format_handler.rb +++ b/lib/puppet/network/format_handler.rb @@ -55,7 +55,7 @@ module Puppet::Network::FormatHandler @formats.each do |name, format| return format if format.extension == ext end - return nil + nil end # Provide a list of all formats. diff --git a/lib/puppet/network/handler/ca.rb b/lib/puppet/network/handler/ca.rb index c72171d5d..101cf6f8e 100644 --- a/lib/puppet/network/handler/ca.rb +++ b/lib/puppet/network/handler/ca.rb @@ -55,7 +55,7 @@ class Puppet::Network::Handler } # for now, just cheat and pass a fake IP address to allowed? - return auth.allowed?(hostname, "127.1.1.1") + auth.allowed?(hostname, "127.1.1.1") end def initialize(hash = {}) diff --git a/lib/puppet/network/handler/filebucket.rb b/lib/puppet/network/handler/filebucket.rb index 13fee1661..c0693ad7a 100755 --- a/lib/puppet/network/handler/filebucket.rb +++ b/lib/puppet/network/handler/filebucket.rb @@ -28,7 +28,7 @@ class Puppet::Network::Handler # :nodoc: def addfile(contents, path, client = nil, clientip = nil) contents = Base64.decode64(contents) if client bucket = Puppet::FileBucket::File.new(contents) - return bucket.save + bucket.save end # Return the contents associated with a given md5 sum. diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index b7a0c1387..efd71223f 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -84,7 +84,7 @@ class Puppet::Network::Handler return "" end - return metadata.attributes_with_tabs + metadata.attributes_with_tabs end # Create a new fileserving module. @@ -159,7 +159,7 @@ class Puppet::Network::Handler @mounts[name] = Mount.new(name, path) @mounts[name].info "Mounted #{path}" - return @mounts[name] + @mounts[name] end # Retrieve a file from the local disk and pass it to the remote @@ -235,7 +235,7 @@ class Puppet::Network::Handler env = (node = Puppet::Node.find(hostname)) ? node.environment : nil # And use the environment to look up the module. - return (mod = Puppet::Node::Environment.new(env).module(module_name) and mod.files?) ? @mounts[MODULES].copy(mod.name, mod.file_directory) : nil + (mod = Puppet::Node::Environment.new(env).module(module_name) and mod.files?) ? @mounts[MODULES].copy(mod.name, mod.file_directory) : nil end # Read the configuration file. @@ -458,7 +458,7 @@ class Puppet::Network::Handler # If there's no relative path name, then we're serving the mount itself. return full_path unless relative_path and relative_path != "/" - return File.join(full_path, relative_path) + File.join(full_path, relative_path) end # Create out object. It must have a name. @@ -505,7 +505,7 @@ class Puppet::Network::Handler # This, ah, might be completely redundant obj[:links] = links unless obj[:links] == links - return obj + obj end # Read the contents of the file at the relative path given. @@ -602,7 +602,7 @@ class Puppet::Network::Handler result = self.clone result.path = path result.instance_variable_set(:@name, name) - return result + result end # List the contents of the relative path +relpath+ of this mount. @@ -635,7 +635,7 @@ class Puppet::Network::Handler return [["/", File.stat(abspath).ftype]] end end - return nil + nil end def reclist(abspath, recurse, ignore) @@ -659,7 +659,7 @@ class Puppet::Network::Handler [ file, stat.ftype ] end - return ary.compact + ary.compact end end diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index 690e7079e..6f2c238a2 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -23,7 +23,7 @@ class Puppet::Network::Handler # Tell a client whether there's a fresh config for it def freshness(client = nil, clientip = nil) # Always force a recompile. Newer clients shouldn't do this (as of April 2008). - return Time.now.to_i + Time.now.to_i end def initialize(hash = {}) @@ -79,7 +79,7 @@ class Puppet::Network::Handler end end - return facts + facts end # Translate our configuration appropriately for sending back to a client. diff --git a/lib/puppet/network/handler/runner.rb b/lib/puppet/network/handler/runner.rb index 4f8247214..bc1a07ac5 100755 --- a/lib/puppet/network/handler/runner.rb +++ b/lib/puppet/network/handler/runner.rb @@ -24,7 +24,7 @@ class Puppet::Network::Handler runner.run - return runner.status + runner.status end end end diff --git a/lib/puppet/network/handler/status.rb b/lib/puppet/network/handler/status.rb index fbdc7a765..fe6c23dc3 100644 --- a/lib/puppet/network/handler/status.rb +++ b/lib/puppet/network/handler/status.rb @@ -9,7 +9,7 @@ class Puppet::Network::Handler } def status(client = nil, clientip = nil) - return 1 + 1 end end end diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb index 265b297ec..577328589 100644 --- a/lib/puppet/network/http/api/v1.rb +++ b/lib/puppet/network/http/api/v1.rb @@ -45,7 +45,7 @@ module Puppet::Network::HTTP::API::V1 raise ArgumentError, "No support for plural #{http_method} operations" end - return method + method end def pluralize(indirection) diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb index 66e0c720e..9f467372c 100644 --- a/lib/puppet/network/http/handler.rb +++ b/lib/puppet/network/http/handler.rb @@ -152,7 +152,7 @@ module Puppet::Network::HTTP::Handler rescue => detail Puppet.err "Could not resolve #{result[:ip]}: #{detail}" end - return result[:ip] + result[:ip] end private diff --git a/lib/puppet/network/http/mongrel/rest.rb b/lib/puppet/network/http/mongrel/rest.rb index 8668bf802..60367a1e8 100644 --- a/lib/puppet/network/http/mongrel/rest.rb +++ b/lib/puppet/network/http/mongrel/rest.rb @@ -87,6 +87,6 @@ class Puppet::Network::HTTP::MongrelREST < Mongrel::HttpHandler result[:authenticated] = false end - return result + result end end diff --git a/lib/puppet/network/http_pool.rb b/lib/puppet/network/http_pool.rb index 2bccba2e8..b4f40c6fe 100644 --- a/lib/puppet/network/http_pool.rb +++ b/lib/puppet/network/http_pool.rb @@ -111,6 +111,6 @@ module Puppet::Network::HttpPool http_cache[key] = http if keep_alive? - return http + http end end diff --git a/lib/puppet/network/http_server/mongrel.rb b/lib/puppet/network/http_server/mongrel.rb index 23ab40bb0..0f81bf2a2 100644 --- a/lib/puppet/network/http_server/mongrel.rb +++ b/lib/puppet/network/http_server/mongrel.rb @@ -137,7 +137,7 @@ module Puppet::Network info = Puppet::Network::ClientRequest.new(client, ip, valid) - return info + info end # Taken from XMLRPC::ParseContentType diff --git a/lib/puppet/network/http_server/webrick.rb b/lib/puppet/network/http_server/webrick.rb index df7a87bf2..e622b7127 100644 --- a/lib/puppet/network/http_server/webrick.rb +++ b/lib/puppet/network/http_server/webrick.rb @@ -33,7 +33,7 @@ module Puppet store.add_file(Puppet[:localcacert]) store.add_crl(crl) - return store + store end # Set up the http log. @@ -60,7 +60,7 @@ module Puppet log = WEBrick::Log.new(*args) - return log + log end # Create our server, yo. diff --git a/lib/puppet/network/rights.rb b/lib/puppet/network/rights.rb index 2c781b390..63ebae892 100755 --- a/lib/puppet/network/rights.rb +++ b/lib/puppet/network/rights.rb @@ -35,7 +35,7 @@ class Rights # if we didn't find the right acl raise end - return true + true end def fail_on_deny(name, args = {}) @@ -235,7 +235,7 @@ class Rights return self.key == namespace_to_key(key) if acl_type == :name # otherwise match with the regex - return self.key.match(key) + self.key.match(key) end def namespace_to_key(key) @@ -254,7 +254,7 @@ class Rights # sort by creation order (ie first match appearing in the file will win) # that is don't sort, in which case the sort algorithm will order in the # natural array order (ie the creation order) - return 0 + 0 end def ==(name) diff --git a/lib/puppet/network/server.rb b/lib/puppet/network/server.rb index dfc7e1008..9f4b5243b 100644 --- a/lib/puppet/network/server.rb +++ b/lib/puppet/network/server.rb @@ -160,6 +160,6 @@ class Puppet::Network::Server def determine_bind_address tmp = Puppet[:bindaddress] return tmp if tmp != "" - return server_type.to_s == "webrick" ? "0.0.0.0" : "127.0.0.1" + server_type.to_s == "webrick" ? "0.0.0.0" : "127.0.0.1" end end diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb index 86b1fbd0b..e19275759 100644 --- a/lib/puppet/network/xmlrpc/client.rb +++ b/lib/puppet/network/xmlrpc/client.rb @@ -40,7 +40,7 @@ module Puppet::Network } } - return newclient + newclient end def self.handler_class(handler) diff --git a/lib/puppet/network/xmlrpc/webrick_servlet.rb b/lib/puppet/network/xmlrpc/webrick_servlet.rb index a3022dbe9..e7fb2ae9c 100644 --- a/lib/puppet/network/xmlrpc/webrick_servlet.rb +++ b/lib/puppet/network/xmlrpc/webrick_servlet.rb @@ -107,7 +107,7 @@ module Puppet::Network::XMLRPC info = Puppet::Network::ClientRequest.new(client, clientip, valid) - return info + info end end end diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb index 97dcc89e6..4f3ef2dad 100644 --- a/lib/puppet/node/environment.rb +++ b/lib/puppet/node/environment.rb @@ -80,7 +80,7 @@ class Puppet::Node::Environment def module(name) mod = Puppet::Module.new(name, self) return nil unless mod.exist? - return mod + mod end # Cache the modulepath, so that we aren't searching through diff --git a/lib/puppet/parameter.rb b/lib/puppet/parameter.rb index 46a37b7b8..c068e8e11 100644 --- a/lib/puppet/parameter.rb +++ b/lib/puppet/parameter.rb @@ -90,7 +90,7 @@ class Puppet::Parameter # Is this parameter the namevar? Defaults to false. def isnamevar? - return defined?(@isnamevar) && @isnamevar + defined?(@isnamevar) && @isnamevar end # This parameter is required. @@ -105,7 +105,7 @@ class Puppet::Parameter # Is this parameter required? Defaults to false. def required? - return defined?(@required) && @required + defined?(@required) && @required end # Verify that we got a good value @@ -198,7 +198,7 @@ class Puppet::Parameter # object can only have one parameter instance of a given parameter # class def name - return self.class.name + self.class.name end # for testing whether we should actually do anything @@ -206,7 +206,7 @@ class Puppet::Parameter @noop = false unless defined?(@noop) tmp = @noop || self.resource.noop || Puppet[:noop] || false #debug "noop is #{tmp}" - return tmp + tmp end # return the full path to us, for logging and rollback; not currently diff --git a/lib/puppet/parser/ast/astarray.rb b/lib/puppet/parser/ast/astarray.rb index dfd2bcd09..f0a0c5602 100644 --- a/lib/puppet/parser/ast/astarray.rb +++ b/lib/puppet/parser/ast/astarray.rb @@ -34,7 +34,7 @@ class Puppet::Parser::AST rets = items.flatten.collect { |child| child.safeevaluate(scope) } - return rets.reject { |o| o.nil? } + rets.reject { |o| o.nil? } end def push(*ary) @@ -45,7 +45,7 @@ class Puppet::Parser::AST @children.push(child) } - return self + self end def to_s diff --git a/lib/puppet/parser/ast/asthash.rb b/lib/puppet/parser/ast/asthash.rb index d04901912..d16b7459f 100644 --- a/lib/puppet/parser/ast/asthash.rb +++ b/lib/puppet/parser/ast/asthash.rb @@ -13,7 +13,7 @@ class Puppet::Parser::AST items.merge!({ key => v.safeevaluate(scope) }) end - return items + items end def merge(hash) diff --git a/lib/puppet/parser/ast/caseopt.rb b/lib/puppet/parser/ast/caseopt.rb index 1268aa7b9..b18a40320 100644 --- a/lib/puppet/parser/ast/caseopt.rb +++ b/lib/puppet/parser/ast/caseopt.rb @@ -31,7 +31,7 @@ class Puppet::Parser::AST @default = false unless defined?(@default) - return @default + @default end # You can specify a list of values; return each in turn. @@ -58,7 +58,7 @@ class Puppet::Parser::AST # Evaluate the actual statements; this only gets called if # our option matched. def evaluate(scope) - return @statements.safeevaluate(scope) + @statements.safeevaluate(scope) end end end diff --git a/lib/puppet/parser/ast/else.rb b/lib/puppet/parser/ast/else.rb index 70e80b4ee..2da9191c8 100644 --- a/lib/puppet/parser/ast/else.rb +++ b/lib/puppet/parser/ast/else.rb @@ -16,7 +16,7 @@ class Puppet::Parser::AST # Evaluate the actual statements; this only gets called if # our test was true matched. def evaluate(scope) - return @statements.safeevaluate(scope) + @statements.safeevaluate(scope) end end end diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb index 79d3d95ed..6f6c869f5 100644 --- a/lib/puppet/parser/ast/function.rb +++ b/lib/puppet/parser/ast/function.rb @@ -31,7 +31,7 @@ class Puppet::Parser::AST # We don't need to evaluate the name, because it's plaintext args = @arguments.safeevaluate(scope) - return scope.send("function_#{@name}", args) + scope.send("function_#{@name}", args) end def initialize(hash) diff --git a/lib/puppet/parser/ast/in_operator.rb b/lib/puppet/parser/ast/in_operator.rb index 05f864edc..1b17b1006 100644 --- a/lib/puppet/parser/ast/in_operator.rb +++ b/lib/puppet/parser/ast/in_operator.rb @@ -18,7 +18,7 @@ class Puppet::Parser::AST unless rval.respond_to?(:include?) raise ArgumentError, "'#{rval}' from right operand of 'in' expression is not of a supported type (string, array or hash)" end - return rval.include?(lval) + rval.include?(lval) end end end diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index 666edd66a..a62edc61e 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -7,7 +7,7 @@ class Puppet::Parser::AST # Return our value. def evaluate(scope) - return @value + @value end # evaluate ourselves, and match @@ -26,7 +26,7 @@ class Puppet::Parser::AST end def to_s - return @value.to_s unless @value.nil? + @value.to_s unless @value.nil? end end @@ -64,7 +64,7 @@ class Puppet::Parser::AST # An uninterpreted string. class FlatString < AST::Leaf def evaluate(scope) - return @value + @value end def to_s @@ -116,11 +116,11 @@ class Puppet::Parser::AST # in a hash it has the same hashing properties as the underlying value def eql?(value) value = value.value if value.is_a?(HostName) - return @value.eql?(value) + @value.eql?(value) end def hash - return @value.hash + @value.hash end def to_s @@ -164,7 +164,7 @@ class Puppet::Parser::AST raise Puppet::ParseError, "#{variable} is not an hash or array when accessing it with #{accesskey}" unless object.is_a?(Hash) or object.is_a?(Array) - return object[evaluate_key(scope)] + object[evaluate_key(scope)] end # Assign value to this hashkey or array index @@ -201,7 +201,7 @@ class Puppet::Parser::AST # this way, we don't have to modify this test specifically for handling # regexes. def evaluate(scope) - return self + self end def evaluate_match(value, scope, options = {}) @@ -218,7 +218,7 @@ class Puppet::Parser::AST end def to_s - return "/#{@value.source}/" + "/#{@value.source}/" end end end diff --git a/lib/puppet/parser/ast/minus.rb b/lib/puppet/parser/ast/minus.rb index 52d158e0b..40f64336c 100644 --- a/lib/puppet/parser/ast/minus.rb +++ b/lib/puppet/parser/ast/minus.rb @@ -17,7 +17,7 @@ class Puppet::Parser::AST if val == nil raise ArgumentError, "minus operand #{val} is not a number" end - return -val + -val end end end diff --git a/lib/puppet/parser/ast/not.rb b/lib/puppet/parser/ast/not.rb index c8fa1df2c..24d5e838b 100644 --- a/lib/puppet/parser/ast/not.rb +++ b/lib/puppet/parser/ast/not.rb @@ -13,7 +13,7 @@ class Puppet::Parser::AST def evaluate(scope) val = @value.safeevaluate(scope) - return ! Puppet::Parser::Scope.true?(val) + ! Puppet::Parser::Scope.true?(val) end end end diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index d2b993017..c03add304 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -125,7 +125,7 @@ class Puppet::Parser::Collector query[:conditions] = [search, *values] - return query + query end # Collect exported objects. @@ -152,7 +152,7 @@ class Puppet::Parser::Collector scope.debug("Collected %s %s resource%s in %.2f seconds" % [count, @type, count == 1 ? "" : "s", time]) - return resources + resources end def collect_resources @@ -182,7 +182,7 @@ class Puppet::Parser::Collector # of collections. @scope.compiler.delete_collection(self) if @resources.empty? - return result + result end # Collect just virtual objects, from our local compiler. @@ -208,7 +208,7 @@ class Puppet::Parser::Collector scope.compiler.add_resource(scope, resource) - return resource + resource end # Does the resource match our tests? We don't yet support tests, diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 7ed000e19..01892ee44 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -87,7 +87,7 @@ class Puppet::Parser::Compiler # Return a list of all of the defined classes. def classlist - return @catalog.classes + @catalog.classes end # Compiler our catalog. This mostly revolves around finding and evaluating classes. @@ -109,7 +109,7 @@ class Puppet::Parser::Compiler fail_on_unevaluated() - return @catalog + @catalog end # LAK:FIXME There are no tests for this. @@ -243,7 +243,7 @@ class Puppet::Parser::Compiler end end - return found_something + found_something end # Make sure all of our resources have been evaluated into native resources. diff --git a/lib/puppet/parser/files.rb b/lib/puppet/parser/files.rb index aad74699f..875a87826 100644 --- a/lib/puppet/parser/files.rb +++ b/lib/puppet/parser/files.rb @@ -24,7 +24,7 @@ module Puppet::Parser::Files # Than that would be a "no." end abspat = File::expand_path(start, cwd) - return [nil, Dir.glob(abspat + (File.extname(abspat).empty? ? '{,.pp,.rb}' : '' )).reject { |f| FileTest.directory?(f) }] + [nil, Dir.glob(abspat + (File.extname(abspat).empty? ? '{,.pp,.rb}' : '' )).reject { |f| FileTest.directory?(f) }] end # Find the concrete file denoted by +file+. If +file+ is absolute, @@ -52,7 +52,7 @@ module Puppet::Parser::Files return td_file end - return nil + nil end def find_template_in_module(template, environment = nil) diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb index c86548bfb..3e56f2a95 100644 --- a/lib/puppet/parser/functions.rb +++ b/lib/puppet/parser/functions.rb @@ -97,7 +97,7 @@ module Puppet::Parser::Functions ret += "\n\n- **Type**: #{hash[:type]}\n\n" end - return ret + ret end def self.functions(env = nil) diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb index b5eab9fc8..7668722d4 100644 --- a/lib/puppet/parser/lexer.rb +++ b/lib/puppet/parser/lexer.rb @@ -306,7 +306,7 @@ class Puppet::Parser::Lexer @indefine = false array.push([token,str]) } - return array + array end def file=(file) @@ -558,7 +558,7 @@ class Puppet::Parser::Lexer # returns the content of the currently accumulated content cache def commentpop - return @commentstack.pop[0] + @commentstack.pop[0] end def getcomment(line = nil) @@ -568,7 +568,7 @@ class Puppet::Parser::Lexer @commentstack.push(['', @line]) return comment[0] end - return '' + '' end def commentpush diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb index e63483050..18d17252c 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -26,7 +26,7 @@ class Puppet::Parser::Parser message += " in file #{file}" end - return message + message end # Create an AST array out of all of the args @@ -40,7 +40,7 @@ class Puppet::Parser::Parser result = ast AST::ASTArray, :children => args end - return result + result end # Create an AST object, and automatically add the file and line information if diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index e29beeb95..baae78a8f 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -216,14 +216,14 @@ class Puppet::Parser::Resource < Puppet::Resource result.virtual = self.virtual result.tag(*self.tags) - return result + result end # Translate our object to a transportable object. def to_trans return nil if virtual? - return to_resource.to_trans + to_resource.to_trans end # Convert this resource to a RAL resource. We hackishly go via the diff --git a/lib/puppet/parser/resource/param.rb b/lib/puppet/parser/resource/param.rb index 3514f1d0c..7ca240df7 100644 --- a/lib/puppet/parser/resource/param.rb +++ b/lib/puppet/parser/resource/param.rb @@ -18,7 +18,7 @@ class Puppet::Parser::Resource::Param end def line_to_i - return line ? Integer(line) : nil + line ? Integer(line) : nil end def to_s diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index f0c7d77bd..3bda512d7 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -65,7 +65,7 @@ class Puppet::Parser::Scope # Is the value true? This allows us to control the definition of truth # in one place. def self.true?(value) - return (value != false and value != "" and value != :undef) + (value != false and value != "" and value != :undef) end # Is the value a number?, return the correct object or nil if not a number @@ -86,7 +86,7 @@ class Puppet::Parser::Scope end end # it is one of Fixnum,Bignum or Float - return value + value end # Add to our list of namespaces. @@ -207,7 +207,7 @@ class Puppet::Parser::Scope #Puppet.debug "Got defaults for %s: %s" % # [type,values.inspect] - return values + values end # Look up a defined type. @@ -228,7 +228,7 @@ class Puppet::Parser::Scope warning "Could not look up qualified variable '#{name}'; class #{klassname} has not been evaluated" return usestring ? "" : :undefined end - return kscope.lookupvar(shortname, usestring) + kscope.lookupvar(shortname, usestring) end private :lookup_qualified_var @@ -271,7 +271,7 @@ class Puppet::Parser::Scope target[name] = value end } - return target + target end def namespaces @@ -410,7 +410,7 @@ class Puppet::Parser::Scope end end - return out + out end # Return the tags associated with this scope. It's basically diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb index 36dc62261..6966387cf 100644 --- a/lib/puppet/parser/templatewrapper.rb +++ b/lib/puppet/parser/templatewrapper.rb @@ -28,17 +28,17 @@ class Puppet::Parser::TemplateWrapper # Allow templates to access the defined classes def classes - return scope.catalog.classes + scope.catalog.classes end # Allow templates to access the tags defined in the current scope def tags - return scope.tags + scope.tags end # Allow templates to access the all the defined tags def all_tags - return scope.catalog.tags + scope.catalog.tags end # Ruby treats variables like methods, so we used to expose variables diff --git a/lib/puppet/parser/type_loader.rb b/lib/puppet/parser/type_loader.rb index 24411522b..37fa03f20 100644 --- a/lib/puppet/parser/type_loader.rb +++ b/lib/puppet/parser/type_loader.rb @@ -55,7 +55,7 @@ class Puppet::Parser::TypeLoader parse_file(file) end - return modname + modname end def imported?(file) diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb index e8aeec053..ec700fbdf 100644 --- a/lib/puppet/property.rb +++ b/lib/puppet/property.rb @@ -169,7 +169,7 @@ class Puppet::Property < Puppet::Parameter @should.each { |val| return true if is == val or is == val.to_s } # otherwise, return false - return false + false end # because the @should and @is vars might be in weird formats, @@ -209,7 +209,7 @@ class Puppet::Property < Puppet::Parameter # this implicitly means that a given object can only have one property # instance of a given property class def name - return self.class.name + self.class.name end # for testing whether we should actually do anything diff --git a/lib/puppet/property/keyvalue.rb b/lib/puppet/property/keyvalue.rb index a1495b6a7..fcd9d57f1 100644 --- a/lib/puppet/property/keyvalue.rb +++ b/lib/puppet/property/keyvalue.rb @@ -81,7 +81,7 @@ module Puppet return true unless is - return (is == self.should) + (is == self.should) end end end diff --git a/lib/puppet/property/list.rb b/lib/puppet/property/list.rb index 2254ed249..fa85ac033 100644 --- a/lib/puppet/property/list.rb +++ b/lib/puppet/property/list.rb @@ -70,7 +70,7 @@ module Puppet return true unless is - return (prepare_is_for_comparison(is) == self.should) + (prepare_is_for_comparison(is) == self.should) end end end diff --git a/lib/puppet/provider.rb b/lib/puppet/provider.rb index 9bfbf8a70..e7a241aaa 100644 --- a/lib/puppet/provider.rb +++ b/lib/puppet/provider.rb @@ -43,7 +43,7 @@ class Puppet::Provider raise Puppet::DevError, "No command #{name} defined for provider #{self.name}" end - return binary(command) + binary(command) end # Define commands that are not optional. @@ -189,7 +189,7 @@ class Puppet::Provider end return true unless features = klass.required_features - return !!satisfies?(*features) + !!satisfies?(*features) end # def self.to_s diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb index e41570105..4fff9e299 100644 --- a/lib/puppet/provider/augeas/augeas.rb +++ b/lib/puppet/provider/augeas/augeas.rb @@ -129,7 +129,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do end args << argline end - return args + args end @@ -186,7 +186,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do else return_value = (result.send(comparator, arg)) end - return !!return_value + !!return_value end # Used by the need_to_run? method to process match filters. Returns @@ -237,20 +237,20 @@ Puppet::Type.type(:augeas).provide(:augeas) do fail("Invalid array in command: #{cmd_array.join(" ")}") end end - return !!return_value + !!return_value end def get_augeas_version - return @aug.get("/augeas/version") || "" + @aug.get("/augeas/version") || "" end def set_augeas_save_mode(mode) - return @aug.set("/augeas/save", mode) + @aug.set("/augeas/save", mode) end def files_changed? saved_files = @aug.match("/augeas/events/saved") - return saved_files.size > 0 + saved_files.size > 0 end # Determines if augeas acutally needs to run. @@ -296,7 +296,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do ensure close_augeas end - return return_value + return_value end def execute_changes @@ -313,7 +313,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do close_augeas end - return :executed + :executed end # Actually execute the augeas changes. diff --git a/lib/puppet/provider/confine.rb b/lib/puppet/provider/confine.rb index 12d8f245e..e75bc5c78 100644 --- a/lib/puppet/provider/confine.rb +++ b/lib/puppet/provider/confine.rb @@ -31,7 +31,7 @@ class Puppet::Provider::Confine # Could not find file end end - return @tests[name] + @tests[name] end attr_reader :values diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb index a9c9889f8..73ca78cf5 100755 --- a/lib/puppet/provider/cron/crontab.rb +++ b/lib/puppet/provider/cron/crontab.rb @@ -134,7 +134,7 @@ tab = case Facter.value(:operatingsystem) return resource if matched end - return false + false end # Collapse name and env records. @@ -191,7 +191,7 @@ tab = case Facter.value(:operatingsystem) text.sub!(tz, '') text = tz + text end - return text + text end def user=(user) diff --git a/lib/puppet/provider/file/posix.rb b/lib/puppet/provider/file/posix.rb index ecfd5a6f8..d715d8802 100644 --- a/lib/puppet/provider/file/posix.rb +++ b/lib/puppet/provider/file/posix.rb @@ -47,7 +47,7 @@ Puppet::Type.type(:file).provide :posix do return true end - return false + false end # Determine if the user is valid, and if so, return the UID @@ -70,7 +70,7 @@ Puppet::Type.type(:file).provide :posix do currentvalue = :silly end - return currentvalue + currentvalue end def sync(path, links, should) @@ -94,6 +94,6 @@ Puppet::Type.type(:file).provide :posix do raise Puppet::Error, "Failed to set owner to '#{uid}': #{detail}" end - return :file_changed + :file_changed end end diff --git a/lib/puppet/provider/file/win32.rb b/lib/puppet/provider/file/win32.rb index a3613cae2..93274ce0a 100644 --- a/lib/puppet/provider/file/win32.rb +++ b/lib/puppet/provider/file/win32.rb @@ -11,7 +11,7 @@ Puppet::Type.type(:file).provide :microsoft_windows do return id.to_s if id.is_a?(Symbol) return nil if id > Puppet[:maximum_uid].to_i # should translate ID numbers to usernames - return id + id end def insync?(current, should) @@ -34,7 +34,7 @@ Puppet::Type.type(:file).provide :microsoft_windows do return true end - return false + false end # Determine if the user is valid, and if so, return the UID @@ -47,7 +47,7 @@ Puppet::Type.type(:file).provide :microsoft_windows do rescue ArgumentError number = nil end - return (number = uid(value)) && number + (number = uid(value)) && number end def retrieve(resource) @@ -65,7 +65,7 @@ Puppet::Type.type(:file).provide :microsoft_windows do currentvalue = :silly end - return currentvalue + currentvalue end def sync(path, links, should) diff --git a/lib/puppet/provider/group/groupadd.rb b/lib/puppet/provider/group/groupadd.rb index d9c50c2d5..496db3ceb 100644 --- a/lib/puppet/provider/group/groupadd.rb +++ b/lib/puppet/provider/group/groupadd.rb @@ -23,7 +23,7 @@ Puppet::Type.type(:group).provide :groupadd, :parent => Puppet::Provider::NameSe cmd << "-o" if @resource.allowdupe? cmd << @resource[:name] - return cmd + cmd end end diff --git a/lib/puppet/provider/group/ldap.rb b/lib/puppet/provider/group/ldap.rb index 73524c268..a4baa6ec1 100644 --- a/lib/puppet/provider/group/ldap.rb +++ b/lib/puppet/provider/group/ldap.rb @@ -43,6 +43,6 @@ Puppet::Type.type(:group).provide :ldap, :parent => Puppet::Provider::Ldap do # Only use the first result. group = result[0] gid = group[:gid][0] - return gid + gid end end diff --git a/lib/puppet/provider/group/pw.rb b/lib/puppet/provider/group/pw.rb index 39fb23800..0f549f2ec 100644 --- a/lib/puppet/provider/group/pw.rb +++ b/lib/puppet/provider/group/pw.rb @@ -28,7 +28,7 @@ Puppet::Type.type(:group).provide :pw, :parent => Puppet::Provider::NameService: # cmd << "-o" #end - return cmd + cmd end end diff --git a/lib/puppet/provider/ldap.rb b/lib/puppet/provider/ldap.rb index 650258957..cc5c67fd2 100644 --- a/lib/puppet/provider/ldap.rb +++ b/lib/puppet/provider/ldap.rb @@ -23,7 +23,7 @@ class Puppet::Provider::Ldap < Puppet::Provider # Set up our getter/setter methods. mk_resource_methods - return @manager + @manager end # Query all of our resources from ldap. @@ -128,6 +128,6 @@ class Puppet::Provider::Ldap < Puppet::Provider end @ldap_properties = attributes - return @ldap_properties.dup + @ldap_properties.dup end end diff --git a/lib/puppet/provider/macauthorization/macauthorization.rb b/lib/puppet/provider/macauthorization/macauthorization.rb index 2e941ecf7..22186de42 100644 --- a/lib/puppet/provider/macauthorization/macauthorization.rb +++ b/lib/puppet/provider/macauthorization/macauthorization.rb @@ -109,7 +109,7 @@ Puppet::Type.type(:macauthorization).provide :macauthorization, :parent => Puppe end def exists? - return !!self.class.parsed_auth_db.has_key?(resource[:name]) + !!self.class.parsed_auth_db.has_key?(resource[:name]) end diff --git a/lib/puppet/provider/mailalias/aliases.rb b/lib/puppet/provider/mailalias/aliases.rb index f946e13df..77b29114f 100755 --- a/lib/puppet/provider/mailalias/aliases.rb +++ b/lib/puppet/provider/mailalias/aliases.rb @@ -37,7 +37,7 @@ require 'puppet/provider/parsedfile' d end end.join(",") - return "#{record[:name]}: #{dest}" + "#{record[:name]}: #{dest}" end end end diff --git a/lib/puppet/provider/mcx/mcxcontent.rb b/lib/puppet/provider/mcx/mcxcontent.rb index 3a1deb5f3..97a778ffe 100644 --- a/lib/puppet/provider/mcx/mcxcontent.rb +++ b/lib/puppet/provider/mcx/mcxcontent.rb @@ -79,7 +79,7 @@ Puppet::Type.type(:mcx).provide :mcxcontent, :parent => Puppet::Provider do end end end - return mcx_list + mcx_list end private @@ -122,7 +122,7 @@ Puppet::Type.type(:mcx).provide :mcxcontent, :parent => Puppet::Provider do raise MCXContentProviderException, "Coult not parse ds_type from resource name '#{name}'. Specify with ds_type parameter." end - return tmp + tmp end # Given the resource name string, parse ds_name out. @@ -132,7 +132,7 @@ Puppet::Type.type(:mcx).provide :mcxcontent, :parent => Puppet::Provider do raise MCXContentProviderException, "Could not parse ds_name from resource name '#{name}'. Specify with ds_name parameter." end - return ds_name + ds_name end # Gather ds_type and ds_name from resource or @@ -178,7 +178,7 @@ Puppet::Type.type(:mcx).provide :mcxcontent, :parent => Puppet::Provider do return false end has_mcx = ! mcx.empty? - return has_mcx + has_mcx end def content @@ -188,7 +188,7 @@ Puppet::Type.type(:mcx).provide :mcxcontent, :parent => Puppet::Provider do ds_parms[:ds_type], ds_parms[:ds_name]) - return mcx + mcx end def content=(value) @@ -200,7 +200,7 @@ Puppet::Type.type(:mcx).provide :mcxcontent, :parent => Puppet::Provider do ds_parms[:ds_name], resource[:content]) - return mcx + mcx end end diff --git a/lib/puppet/provider/nameservice.rb b/lib/puppet/provider/nameservice.rb index 1dda05d9f..3f485c3af 100644 --- a/lib/puppet/provider/nameservice.rb +++ b/lib/puppet/provider/nameservice.rb @@ -6,7 +6,7 @@ require 'puppet' class Puppet::Provider::NameService < Puppet::Provider class << self def autogen_default(param) - return defined?(@autogen_defaults) ? @autogen_defaults[symbolize(param)] : nil + defined?(@autogen_defaults) ? @autogen_defaults[symbolize(param)] : nil end def autogen_defaults(hash) @@ -32,7 +32,7 @@ class Puppet::Provider::NameService < Puppet::Provider def option(name, option) name = name.intern if name.is_a? String - return (defined?(@options) and @options.include? name and @options[name].include? option) ? @options[name][option] : nil + (defined?(@options) and @options.include? name and @options[name].include? option) ? @options[name][option] : nil end def options(name, hash) @@ -61,7 +61,7 @@ class Puppet::Provider::NameService < Puppet::Provider Etc.send("end#{section()}ent") end - return names + names end def resource_type=(resource_type) @@ -153,7 +153,7 @@ class Puppet::Provider::NameService < Puppet::Provider @@prevauto = highest + 1 end - return @@prevauto + @@prevauto end def create @@ -194,12 +194,12 @@ class Puppet::Provider::NameService < Puppet::Provider # Does our object exist? def exists? - return !!getinfo(true) + !!getinfo(true) end # Retrieve a specific value by name. def get(param) - return (hash = getinfo(false)) ? hash[param] : nil + (hash = getinfo(false)) ? hash[param] : nil end # Retrieve what we can about our object @@ -214,7 +214,7 @@ class Puppet::Provider::NameService < Puppet::Provider end # Now convert our Etc struct into a hash. - return @objectinfo ? info2hash(@objectinfo) : nil + @objectinfo ? info2hash(@objectinfo) : nil end # The list of all groups the user is a member of. Different @@ -250,7 +250,7 @@ class Puppet::Provider::NameService < Puppet::Provider hash[param] = info.send(posixmethod(param)) if info.respond_to? method end - return hash + hash end def initialize(resource) diff --git a/lib/puppet/provider/nameservice/directoryservice.rb b/lib/puppet/provider/nameservice/directoryservice.rb index 5ee4d8e21..b98a38c12 100644 --- a/lib/puppet/provider/nameservice/directoryservice.rb +++ b/lib/puppet/provider/nameservice/directoryservice.rb @@ -98,7 +98,7 @@ class DirectoryService < Puppet::Provider::NameService # Remember this is a class method, so self.class is Class # Also, @resource_type seems to be the reference to the # Puppet::Type this class object is providing for. - return @resource_type.name.to_s.capitalize + "s" + @resource_type.name.to_s.capitalize + "s" end def self.get_macosx_version_major @@ -132,7 +132,7 @@ class DirectoryService < Puppet::Provider::NameService rescue Puppet::ExecutionFailure => detail fail("Could not get #{@resource_type.name} list from DirectoryService") end - return dscl_output.split("\n") + dscl_output.split("\n") end def self.parse_dscl_url_data(dscl_output) @@ -172,11 +172,11 @@ class DirectoryService < Puppet::Provider::NameService dscl_plist[key] = [value] end end - return dscl_plist + dscl_plist end def self.parse_dscl_plist_data(dscl_output) - return Plist.parse_xml(dscl_output) + Plist.parse_xml(dscl_output) end def self.generate_attribute_hash(input_hash, *type_properties) @@ -208,7 +208,7 @@ class DirectoryService < Puppet::Provider::NameService # UUID of the user record for non-Mobile local acccounts. # Mobile Accounts are out of scope for this provider for now attribute_hash[:password] = self.get_password(attribute_hash[:guid]) if @resource_type.validproperties.include?(:password) and Puppet.features.root? - return attribute_hash + attribute_hash end def self.single_report(resource_name, *type_properties) @@ -242,7 +242,7 @@ class DirectoryService < Puppet::Provider::NameService dscl_plist = self.parse_dscl_plist_data(dscl_output) end - return self.generate_attribute_hash(dscl_plist, *type_properties) + self.generate_attribute_hash(dscl_plist, *type_properties) end def self.get_exec_preamble(ds_action, resource_name = nil) @@ -275,7 +275,7 @@ class DirectoryService < Puppet::Provider::NameService end # JJM: This returns most of the preamble of the command. # e.g. 'dscl / -create /Users/mccune' - return command_vector + command_vector end def self.set_password(resource_name, guid, password_hash) @@ -510,7 +510,7 @@ class DirectoryService < Puppet::Provider::NameService @property_value_cache_hash[param] = @property_value_cache_hash[param].to_i if @property_value_cache_hash and @property_value_cache_hash.include?(param) end end - return @property_value_cache_hash + @property_value_cache_hash end end end diff --git a/lib/puppet/provider/nameservice/objectadd.rb b/lib/puppet/provider/nameservice/objectadd.rb index 256368ee1..25528be85 100644 --- a/lib/puppet/provider/nameservice/objectadd.rb +++ b/lib/puppet/provider/nameservice/objectadd.rb @@ -19,14 +19,14 @@ class ObjectAdd < Puppet::Provider::NameService end cmd << @resource[:name] - return cmd + cmd end def posixmethod(name) name = name.intern if name.is_a? String method = self.class.option(name, :method) || name - return method + method end end end diff --git a/lib/puppet/provider/nameservice/pw.rb b/lib/puppet/provider/nameservice/pw.rb index 4e8134627..702d705c6 100644 --- a/lib/puppet/provider/nameservice/pw.rb +++ b/lib/puppet/provider/nameservice/pw.rb @@ -14,7 +14,7 @@ class PW < ObjectAdd flag(param), value ] - return cmd + cmd end end end diff --git a/lib/puppet/provider/package/aix.rb b/lib/puppet/provider/package/aix.rb index fd0cfdc7e..dce4ccb42 100644 --- a/lib/puppet/provider/package/aix.rb +++ b/lib/puppet/provider/package/aix.rb @@ -18,7 +18,7 @@ Puppet::Type.type(:package).provide :aix, :parent => Puppet::Provider::Package d attr_accessor :latest_info def self.srclistcmd(source) - return [ command(:installp), "-L", "-d", source ] + [ command(:installp), "-L", "-d", source ] end def self.prefetch(packages) @@ -119,7 +119,7 @@ Puppet::Type.type(:package).provide :aix, :parent => Puppet::Provider::Package d end def query - return self.class.pkglist(:pkgname => @resource[:name]) + self.class.pkglist(:pkgname => @resource[:name]) end def update diff --git a/lib/puppet/provider/package/appdmg.rb b/lib/puppet/provider/package/appdmg.rb index 011a5f509..540bcb1ad 100644 --- a/lib/puppet/provider/package/appdmg.rb +++ b/lib/puppet/provider/package/appdmg.rb @@ -93,7 +93,7 @@ Puppet::Type.type(:package).provide(:appdmg, :parent => Puppet::Provider::Packag end # def self.installpkgdmg def query - return FileTest.exists?("/var/db/.puppet_appdmg_installed_#{@resource[:name]}") ? {:name => @resource[:name], :ensure => :present} : nil + FileTest.exists?("/var/db/.puppet_appdmg_installed_#{@resource[:name]}") ? {:name => @resource[:name], :ensure => :present} : nil end def install diff --git a/lib/puppet/provider/package/apple.rb b/lib/puppet/provider/package/apple.rb index 49875da51..613e14e5e 100755 --- a/lib/puppet/provider/package/apple.rb +++ b/lib/puppet/provider/package/apple.rb @@ -36,7 +36,7 @@ Puppet::Type.type(:package).provide :apple, :parent => Puppet::Provider::Package end def query - return FileTest.exists?("/Library/Receipts/#{@resource[:name]}.pkg") ? {:name => @resource[:name], :ensure => :present} : nil + FileTest.exists?("/Library/Receipts/#{@resource[:name]}.pkg") ? {:name => @resource[:name], :ensure => :present} : nil end def install diff --git a/lib/puppet/provider/package/darwinport.rb b/lib/puppet/provider/package/darwinport.rb index 4b9fdb462..6ba7c5772 100755 --- a/lib/puppet/provider/package/darwinport.rb +++ b/lib/puppet/provider/package/darwinport.rb @@ -40,7 +40,7 @@ Puppet::Type.type(:package).provide :darwinport, :parent => Puppet::Provider::Pa packages << new(hash) end - return packages + packages end def install @@ -59,7 +59,7 @@ Puppet::Type.type(:package).provide :darwinport, :parent => Puppet::Provider::Pa return hash if hash[:name] == @resource[:name] end - return nil + nil end def latest @@ -72,7 +72,7 @@ Puppet::Type.type(:package).provide :darwinport, :parent => Puppet::Provider::Pa ary = info.split(/\s+/) version = ary[2].sub(/^@/, '') - return version + version end def uninstall @@ -80,7 +80,7 @@ Puppet::Type.type(:package).provide :darwinport, :parent => Puppet::Provider::Pa end def update - return install() + install() end end diff --git a/lib/puppet/provider/package/dpkg.rb b/lib/puppet/provider/package/dpkg.rb index 77f7a61eb..06d3f58f8 100755 --- a/lib/puppet/provider/package/dpkg.rb +++ b/lib/puppet/provider/package/dpkg.rb @@ -31,7 +31,7 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package } end - return packages + packages end self::REGEX = %r{^(\S+) +(\S+) +(\S+) (\S+) (\S*)$} @@ -58,7 +58,7 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package return nil end - return hash + hash end def install @@ -122,7 +122,7 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package ) end - return hash + hash end def uninstall diff --git a/lib/puppet/provider/package/freebsd.rb b/lib/puppet/provider/package/freebsd.rb index 20ded987e..95d15c735 100755 --- a/lib/puppet/provider/package/freebsd.rb +++ b/lib/puppet/provider/package/freebsd.rb @@ -40,7 +40,7 @@ Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do return provider.properties end end - return nil + nil end def uninstall diff --git a/lib/puppet/provider/package/gem.rb b/lib/puppet/provider/package/gem.rb index 53677a9c5..90b436fa6 100755 --- a/lib/puppet/provider/package/gem.rb +++ b/lib/puppet/provider/package/gem.rb @@ -106,7 +106,7 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d # This always gets the latest version available. hash = self.class.gemlist(:justme => resource[:name]) - return hash[:ensure] + hash[:ensure] end def query diff --git a/lib/puppet/provider/package/hpux.rb b/lib/puppet/provider/package/hpux.rb index 76922dc09..f3283de08 100644 --- a/lib/puppet/provider/package/hpux.rb +++ b/lib/puppet/provider/package/hpux.rb @@ -41,6 +41,6 @@ Puppet::Type.type(:package).provide :hpux, :parent => Puppet::Provider::Package end def standard_args - return ["-x", "mount_all_filesystems=false"] + ["-x", "mount_all_filesystems=false"] end end diff --git a/lib/puppet/provider/package/nim.rb b/lib/puppet/provider/package/nim.rb index 8b273767e..33d4bf11d 100644 --- a/lib/puppet/provider/package/nim.rb +++ b/lib/puppet/provider/package/nim.rb @@ -18,7 +18,7 @@ Puppet::Type.type(:package).provide :nim, :parent => :aix, :source => :aix do attr_accessor :latest_info def self.srclistcmd(source) - return [ command(:nimclient), "-o", "showres", "-a", "installp_flags=L", "-a", "resource=#{source}" ] + [ command(:nimclient), "-o", "showres", "-a", "installp_flags=L", "-a", "resource=#{source}" ] end def install(useversion = true) diff --git a/lib/puppet/provider/package/openbsd.rb b/lib/puppet/provider/package/openbsd.rb index f5f978056..cff599bca 100755 --- a/lib/puppet/provider/package/openbsd.rb +++ b/lib/puppet/provider/package/openbsd.rb @@ -112,7 +112,7 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa return nil end - return hash + hash end def uninstall diff --git a/lib/puppet/provider/package/pkg.rb b/lib/puppet/provider/package/pkg.rb index ab8429864..35a712100 100644 --- a/lib/puppet/provider/package/pkg.rb +++ b/lib/puppet/provider/package/pkg.rb @@ -51,7 +51,7 @@ Puppet::Type.type(:package).provide :pkg, :parent => Puppet::Provider::Package d return nil end - return hash + hash end # return the version of the package @@ -102,7 +102,7 @@ Puppet::Type.type(:package).provide :pkg, :parent => Puppet::Provider::Package d raise Puppet::Error.new( "Package #{hash[:name]}, version #{hash[:version]} is in error state: #{hash[:error]}") if hash[:error] != "ok" - return hash + hash end end diff --git a/lib/puppet/provider/package/portage.rb b/lib/puppet/provider/package/portage.rb index a8d071f41..82d16699c 100644 --- a/lib/puppet/provider/package/portage.rb +++ b/lib/puppet/provider/package/portage.rb @@ -117,6 +117,6 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa end def latest - return self.query[:version_available] + self.query[:version_available] end end diff --git a/lib/puppet/provider/package/ports.rb b/lib/puppet/provider/package/ports.rb index 4a925aa8d..014f31530 100755 --- a/lib/puppet/provider/package/ports.rb +++ b/lib/puppet/provider/package/ports.rb @@ -66,7 +66,7 @@ Puppet::Type.type(:package).provide :ports, :parent => :freebsd, :source => :fre source, newversion = $1, $2 debug "Newer version in #{source}" - return newversion + newversion end def query @@ -81,7 +81,7 @@ Puppet::Type.type(:package).provide :ports, :parent => :freebsd, :source => :fre end end - return nil + nil end def uninstall diff --git a/lib/puppet/provider/package/rpm.rb b/lib/puppet/provider/package/rpm.rb index abcfbd3b6..cabdd1b1f 100755 --- a/lib/puppet/provider/package/rpm.rb +++ b/lib/puppet/provider/package/rpm.rb @@ -45,7 +45,7 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr raise Puppet::Error, "Failed to list packages" end - return packages + packages end # Find the fully versioned package name and the version alone. Returns @@ -67,7 +67,7 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr # for multilib @property_hash.update(self.class.nevra_to_hash(output)) - return @property_hash.dup + @property_hash.dup end # Here we just retrieve the version from the file specified in the source. @@ -78,7 +78,7 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr cmd = [command(:rpm), "-q", "--qf", "#{NEVRAFORMAT}\n", "-p", "#{@resource[:source]}"] h = self.class.nevra_to_hash(execfail(cmd, Puppet::Error)) - return h[:ensure] + h[:ensure] end def install @@ -126,7 +126,7 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr NEVRA_FIELDS.zip(line.split) { |f, v| hash[f] = v } hash[:provider] = self.name hash[:ensure] = "#{hash[:version]}-#{hash[:release]}" - return hash + hash end end diff --git a/lib/puppet/provider/package/sun.rb b/lib/puppet/provider/package/sun.rb index 2d4e1ac3f..c98636e11 100755 --- a/lib/puppet/provider/package/sun.rb +++ b/lib/puppet/provider/package/sun.rb @@ -57,7 +57,7 @@ Puppet::Type.type(:package).provide :sun, :parent => Puppet::Provider::Package d end } } - return packages + packages end # Get info on a package, optionally specifying a device. diff --git a/lib/puppet/provider/parsedfile.rb b/lib/puppet/provider/parsedfile.rb index 1ca3e31ca..cdbcdd05d 100755 --- a/lib/puppet/provider/parsedfile.rb +++ b/lib/puppet/provider/parsedfile.rb @@ -25,7 +25,7 @@ class Puppet::Provider::ParsedFile < Puppet::Provider newhash.delete(p) if newhash.include?(p) end - return newhash + newhash end def self.clear @@ -35,7 +35,7 @@ class Puppet::Provider::ParsedFile < Puppet::Provider def self.filetype @filetype = Puppet::Util::FileType.filetype(:flat) unless defined?(@filetype) - return @filetype + @filetype end def self.filetype=(type) @@ -312,17 +312,17 @@ class Puppet::Provider::ParsedFile < Puppet::Provider end end mark_target_modified() - return (@resource.class.name.to_s + "_created").intern + (@resource.class.name.to_s + "_created").intern end def destroy # We use the method here so it marks the target as modified. self.ensure = :absent - return (@resource.class.name.to_s + "_deleted").intern + (@resource.class.name.to_s + "_deleted").intern end def exists? - return !(@property_hash[:ensure] == :absent or @property_hash[:ensure].nil?) + !(@property_hash[:ensure] == :absent or @property_hash[:ensure].nil?) end # Write our data to disk. diff --git a/lib/puppet/provider/selboolean/getsetsebool.rb b/lib/puppet/provider/selboolean/getsetsebool.rb index 21604efd4..259d9471e 100644 --- a/lib/puppet/provider/selboolean/getsetsebool.rb +++ b/lib/puppet/provider/selboolean/getsetsebool.rb @@ -26,7 +26,7 @@ Puppet::Type.type(:selboolean).provide(:getsetsebool) do persist = "-P" end execoutput("#{command(:setsebool)} #{persist} #{@resource[:name]} #{new}") - return :file_changed + :file_changed end # Required workaround, since SELinux policy prevents setsebool @@ -42,6 +42,6 @@ Puppet::Type.type(:selboolean).provide(:getsetsebool) do rescue Puppet::ExecutionFailure raise Puppet::ExecutionFailure, output.split("\n")[0] end - return output + output end end diff --git a/lib/puppet/provider/selmodule/semodule.rb b/lib/puppet/provider/selmodule/semodule.rb index 2f88d3dfe..0b72618ec 100644 --- a/lib/puppet/provider/selmodule/semodule.rb +++ b/lib/puppet/provider/selmodule/semodule.rb @@ -9,7 +9,7 @@ Puppet::Type.type(:selmodule).provide(:semodule) do rescue Puppet::ExecutionFailure => detail raise Puppet::Error, "Could not load policy module: #{detail}"; end - return :true + :true end def destroy @@ -29,7 +29,7 @@ Puppet::Type.type(:selmodule).provide(:semodule) do end end end - return nil + nil end def syncversion @@ -43,7 +43,7 @@ Puppet::Type.type(:selmodule).provide(:semodule) do return :true end end - return :false + :false end def syncversion= (dosync) @@ -65,7 +65,7 @@ Puppet::Type.type(:selmodule).provide(:semodule) do rescue Puppet::ExecutionFailure raise Puppet::ExecutionFailure, output.split("\n")[0] end - return output + output end def selmod_name_to_filename @@ -78,7 +78,7 @@ Puppet::Type.type(:selmodule).provide(:semodule) do def selmod_readnext (handle) len = handle.read(4).unpack('L')[0] - return handle.read(len) + handle.read(len) end def selmodversion_file @@ -114,7 +114,7 @@ Puppet::Type.type(:selmodule).provide(:semodule) do v = selmod_readnext(mod) self.debug "file version #{v}" - return v + v end def selmodversion_loaded @@ -134,6 +134,6 @@ Puppet::Type.type(:selmodule).provide(:semodule) do rescue Puppet::ExecutionFailure raise Puppet::ExecutionFailure, "Could not list policy modules: #{lines.join(' ').chomp!}" end - return nil + nil end end diff --git a/lib/puppet/provider/service/base.rb b/lib/puppet/provider/service/base.rb index 42f2ea01c..50e8790d1 100755 --- a/lib/puppet/provider/service/base.rb +++ b/lib/puppet/provider/service/base.rb @@ -32,7 +32,7 @@ Puppet::Type.type(:service).provide :base do } } - return nil + nil end # How to restart the process. @@ -128,7 +128,7 @@ Puppet::Type.type(:service).provide :base do rescue Puppet::ExecutionFailure => detail @resource.fail "Could not #{type} #{@resource.ref}: #{detail}" end - return nil + nil end # Use either a specified command or the default for our provider. @@ -138,7 +138,7 @@ Puppet::Type.type(:service).provide :base do else cmd = [send("#{type}cmd")].flatten end - return texecute(type, cmd, fof) + texecute(type, cmd, fof) end end diff --git a/lib/puppet/provider/service/bsd.rb b/lib/puppet/provider/service/bsd.rb index 814dbd340..15e4385a1 100644 --- a/lib/puppet/provider/service/bsd.rb +++ b/lib/puppet/provider/service/bsd.rb @@ -25,7 +25,7 @@ Puppet::Type.type(:service).provide :bsd, :parent => :init do rcfile = File.join(@@rcconf_dir, @model[:name]) return :true if File.exists?(rcfile) - return :false + :false end # enable service by creating a service file under rc.conf.d with the diff --git a/lib/puppet/provider/service/daemontools.rb b/lib/puppet/provider/service/daemontools.rb index e8409860a..f5f2607e3 100644 --- a/lib/puppet/provider/service/daemontools.rb +++ b/lib/puppet/provider/service/daemontools.rb @@ -121,7 +121,7 @@ Puppet::Type.type(:service).provide :daemontools, :parent => :base do rescue Puppet::ExecutionFailure => detail raise Puppet::Error.new( "Could not get status for service #{resource.ref}: #{detail}" ) end - return :stopped + :stopped end def setupservice diff --git a/lib/puppet/provider/service/freebsd.rb b/lib/puppet/provider/service/freebsd.rb index 05383a998..3ff81fdfb 100644 --- a/lib/puppet/provider/service/freebsd.rb +++ b/lib/puppet/provider/service/freebsd.rb @@ -18,7 +18,7 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do def rcvar rcvar = execute([self.initscript, :rcvar], :failonfail => true, :squelch => false) rcvar = rcvar.split("\n") - return rcvar + rcvar end # Extract service name @@ -28,7 +28,7 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do name = name.gsub!(/# (.*)/, '\1') self.error("Service name is empty") if name.nil? self.debug("Service name is #{name}") - return name + name end # Extract rcvar name @@ -38,7 +38,7 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do name = name.gsub!(/(.*)_enable=(.*)/, '\1') self.error("rcvar name is empty") if name.nil? self.debug("rcvar name is #{name}") - return name + name end # Extract rcvar value @@ -48,7 +48,7 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do value = value.gsub!(/(.*)_enable=\"?(.*)\"?/, '\2') self.error("rcvar value is empty") if value.nil? self.debug("rcvar value is #{value}") - return value + value end # Edit rc files and set the service to yes/no @@ -74,7 +74,7 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do end end end - return success + success end # Add a new setting to the rc files @@ -109,7 +109,7 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do return :true end self.debug("Is disabled") - return :false + :false end def enable diff --git a/lib/puppet/provider/service/launchd.rb b/lib/puppet/provider/service/launchd.rb index 1813f2cfb..9be961b09 100644 --- a/lib/puppet/provider/service/launchd.rb +++ b/lib/puppet/provider/service/launchd.rb @@ -216,7 +216,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do elsif overrides_disabled == false return :true end - return :false + :false end diff --git a/lib/puppet/provider/service/redhat.rb b/lib/puppet/provider/service/redhat.rb index c49df3142..b31faa586 100755 --- a/lib/puppet/provider/service/redhat.rb +++ b/lib/puppet/provider/service/redhat.rb @@ -42,7 +42,7 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init, :source => :init return :false end - return :true + :true end # Don't support them specifying runlevels; always use the runlevels diff --git a/lib/puppet/provider/service/runit.rb b/lib/puppet/provider/service/runit.rb index 3b49d14ef..26c8954e8 100644 --- a/lib/puppet/provider/service/runit.rb +++ b/lib/puppet/provider/service/runit.rb @@ -75,7 +75,7 @@ Puppet::Type.type(:service).provide :runit, :parent => :daemontools do raise Puppet::Error.new( "Could not get status for service #{resource.ref}: #{detail}" ) end end - return :stopped + :stopped end def stop diff --git a/lib/puppet/provider/user/directoryservice.rb b/lib/puppet/provider/user/directoryservice.rb index d3cb4f244..46d017e4b 100644 --- a/lib/puppet/provider/user/directoryservice.rb +++ b/lib/puppet/provider/user/directoryservice.rb @@ -40,7 +40,7 @@ Puppet::Type.type(:user).provide :directoryservice, :parent => Puppet::Provider: end def autogen_comment - return @resource[:name].capitalize + @resource[:name].capitalize end # The list of all groups the user is a member of. diff --git a/lib/puppet/provider/user/ldap.rb b/lib/puppet/provider/user/ldap.rb index 03fa0d376..3a91b4f92 100644 --- a/lib/puppet/provider/user/ldap.rb +++ b/lib/puppet/provider/user/ldap.rb @@ -63,7 +63,7 @@ Puppet::Type.type(:user).provide :ldap, :parent => Puppet::Provider::Ldap do return @property_hash[:groups] = result.collect { |r| r[:name] }.sort.join(",") end - return @property_hash[:groups] + @property_hash[:groups] end # Manage the list of groups this user is a member of. diff --git a/lib/puppet/provider/user/pw.rb b/lib/puppet/provider/user/pw.rb index cee136ec8..7d3eda281 100644 --- a/lib/puppet/provider/user/pw.rb +++ b/lib/puppet/provider/user/pw.rb @@ -35,7 +35,7 @@ Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService:: cmd << "-m" if @resource.managehome? - return cmd + cmd end end diff --git a/lib/puppet/provider/user/useradd.rb b/lib/puppet/provider/user/useradd.rb index e6c9aa5f4..7645969ff 100644 --- a/lib/puppet/provider/user/useradd.rb +++ b/lib/puppet/provider/user/useradd.rb @@ -63,7 +63,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ return ent.sp_pwdp end end - return :absent + :absent end end diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb index e35db6f56..90c9f543c 100644 --- a/lib/puppet/provider/zone/solaris.rb +++ b/lib/puppet/provider/zone/solaris.rb @@ -21,7 +21,7 @@ Puppet::Type.type(:zone).provide(:solaris) do properties[:ensure] = symbolize(properties[:ensure]) - return properties + properties end def self.instances @@ -132,7 +132,7 @@ Puppet::Type.type(:zone).provide(:solaris) do end end - return hash + hash end # Execute a configuration string. Can't be private because it's called diff --git a/lib/puppet/rails/host.rb b/lib/puppet/rails/host.rb index 7a3fe75bc..854df2bd4 100644 --- a/lib/puppet/rails/host.rb +++ b/lib/puppet/rails/host.rb @@ -78,7 +78,7 @@ class Puppet::Rails::Host < ActiveRecord::Base # This only runs if time debugging is enabled. write_benchmarks - return host + host end # Return the value of a fact. @@ -238,7 +238,7 @@ class Puppet::Rails::Host < ActiveRecord::Base db_resource.save - return db_resource + db_resource end @@ -256,7 +256,7 @@ class Puppet::Rails::Host < ActiveRecord::Base end log_accumulated_marks "Resource merger" - return additions + additions end def remove_unneeded_resources(compiled, existing) @@ -284,7 +284,7 @@ class Puppet::Rails::Host < ActiveRecord::Base # dependent objects get removed, too. Puppet::Rails::Resource.destroy(deletions) unless deletions.empty? - return resources + resources end def find_resources_parameters(resources) diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb index 3b2e78b3a..46b49ba1b 100644 --- a/lib/puppet/rails/resource.rb +++ b/lib/puppet/rails/resource.rb @@ -48,7 +48,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base end def file - return (f = self.source_file) ? f.filename : nil + (f = self.source_file) ? f.filename : nil end def file=(file) @@ -84,7 +84,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base end def [](param) - return super || parameter(param) + super || parameter(param) end # Make sure this resource is equivalent to the provided Parser resource. @@ -226,6 +226,6 @@ class Puppet::Rails::Resource < ActiveRecord::Base # Store the ID, so we can check if we're re-collecting the same resource. obj.rails_id = self.id - return obj + obj end end diff --git a/lib/puppet/reports/rrdgraph.rb b/lib/puppet/reports/rrdgraph.rb index e478912b2..0b1bd873e 100644 --- a/lib/puppet/reports/rrdgraph.rb +++ b/lib/puppet/reports/rrdgraph.rb @@ -42,7 +42,7 @@ Puppet::Reports.register_report(:rrdgraph) do of.puts "</body></html>" end - return file + file end def mkhtml diff --git a/lib/puppet/reports/store.rb b/lib/puppet/reports/store.rb index aa99a7260..384f0eb0a 100644 --- a/lib/puppet/reports/store.rb +++ b/lib/puppet/reports/store.rb @@ -54,7 +54,7 @@ Puppet::Reports.register_report(:store) do end # Only testing cares about the return value - return file + file end end diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb index 1e6c52bfc..f77d3c9fb 100644 --- a/lib/puppet/reports/tagmail.rb +++ b/lib/puppet/reports/tagmail.rb @@ -64,7 +64,7 @@ Puppet::Reports.register_report(:tagmail) do end end - return matching_logs + matching_logs end # Load the config file @@ -100,7 +100,7 @@ Puppet::Reports.register_report(:tagmail) do emails = emails.sub(/\s+$/,'').split(/\s*,\s*/) taglists << [emails, pos, neg] end - return taglists + taglists end # Process the report. This just calls the other associated messages. diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb index b41763a9c..88f85c3ad 100644 --- a/lib/puppet/resource.rb +++ b/lib/puppet/resource.rb @@ -255,7 +255,7 @@ class Puppet::Resource result.file = self.file result.line = self.line - return result + result end def to_trans_ref @@ -289,7 +289,7 @@ class Puppet::Resource result.tags = self.tags - return result + result end def name @@ -388,7 +388,7 @@ class Puppet::Resource bucket.name = self.title # TransBuckets don't support parameters, which is why they're being deprecated. - return bucket + bucket end def extract_parameters(params) @@ -455,7 +455,7 @@ class Puppet::Resource if klass = find_hostclass(title) result = klass.name end - return munge_type_name(result || title) + munge_type_name(result || title) end def parse_title diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb index 12bbffcc5..365aa0709 100644 --- a/lib/puppet/resource/catalog.rb +++ b/lib/puppet/resource/catalog.rb @@ -252,7 +252,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph # Clear the cache to encourage the GC buckets.clear - return result + result end # Make sure all of our resources are "finished". @@ -584,7 +584,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph result.add_class(*self.classes) result.tag(*self.tags) - return result + result end def virtual_not_exported?(resource) diff --git a/lib/puppet/resource/type.rb b/lib/puppet/resource/type.rb index b1188491a..572a4f8c4 100644 --- a/lib/puppet/resource/type.rb +++ b/lib/puppet/resource/type.rb @@ -98,7 +98,7 @@ class Puppet::Resource::Type def match(string) return string.to_s.downcase == name unless name_is_regex? - return @name =~ string + @name =~ string end # Add code from a new instance to our code. @@ -162,7 +162,7 @@ class Puppet::Resource::Type def name return @name unless @name.is_a?(Regexp) - return @name.source.downcase.gsub(/[^-\w:.]/,'').sub(/^\.+/,'') + @name.source.downcase.gsub(/[^-\w:.]/,'').sub(/^\.+/,'') end def name_is_regex? @@ -257,7 +257,7 @@ class Puppet::Resource::Type def evaluate_parent_type(resource) return unless klass = parent_type and parent_resource = resource.scope.compiler.catalog.resource(:class, klass.name) || resource.scope.compiler.catalog.resource(:node, klass.name) parent_resource.evaluate unless parent_resource.evaluated? - return parent_scope(resource.scope, klass) + parent_scope(resource.scope, klass) end def evaluate_ruby_code(resource, scope) diff --git a/lib/puppet/resource/type_collection.rb b/lib/puppet/resource/type_collection.rb index 4dbf753be..39883ac67 100644 --- a/lib/puppet/resource/type_collection.rb +++ b/lib/puppet/resource/type_collection.rb @@ -131,7 +131,7 @@ class Puppet::Resource::TypeCollection return r end - return loader.load_until(namespaces, name) { find(namespaces, name, type) } + loader.load_until(namespaces, name) { find(namespaces, name, type) } end def find_node(name) diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb index e0d969558..24f4399cc 100644 --- a/lib/puppet/simple_graph.rb +++ b/lib/puppet/simple_graph.rb @@ -30,7 +30,7 @@ class Puppet::SimpleGraph return send(direction.to_s + "_edges") if options[:type] == :edges - return @adjacencies[direction].keys.reject { |vertex| @adjacencies[direction][vertex].empty? } + @adjacencies[direction].keys.reject { |vertex| @adjacencies[direction][vertex].empty? } end # Add an edge to our list. @@ -135,7 +135,7 @@ class Puppet::SimpleGraph def leaves(vertex, direction = :out) tree = tree_from_vertex(vertex, direction) l = tree.keys.find_all { |c| adjacent(c, :direction => direction).empty? } - return l + l end # Collect all of the edges that the passed events match. Returns @@ -205,7 +205,7 @@ class Puppet::SimpleGraph raise Puppet::Error, "Found dependency cycles in the following relationships: #{message}; try using the '--graph' option and open the '.dot' files in OmniGraffle or GraphViz" end - return result + result end # Add a new vertex to the graph. @@ -285,7 +285,7 @@ class Puppet::SimpleGraph # Find adjacent edges. def adjacent(vertex, options = {}) return [] unless wrapper = @vertices[vertex] - return wrapper.adjacent(options) + wrapper.adjacent(options) end private diff --git a/lib/puppet/ssl/certificate.rb b/lib/puppet/ssl/certificate.rb index f9297f380..07dd0c8e6 100644 --- a/lib/puppet/ssl/certificate.rb +++ b/lib/puppet/ssl/certificate.rb @@ -29,6 +29,6 @@ class Puppet::SSL::Certificate < Puppet::SSL::Base def expiration return nil unless content - return content.not_after + content.not_after end end diff --git a/lib/puppet/ssl/certificate_authority.rb b/lib/puppet/ssl/certificate_authority.rb index 1c6e76f86..357e54e9f 100644 --- a/lib/puppet/ssl/certificate_authority.rb +++ b/lib/puppet/ssl/certificate_authority.rb @@ -34,7 +34,7 @@ class Puppet::SSL::CertificateAuthority def self.ca? return false unless Puppet[:ca] return false unless Puppet.run_mode.master? - return true + true end # If this process can function as a CA, then return a singleton @@ -75,7 +75,7 @@ class Puppet::SSL::CertificateAuthority return true if ['true', true].include?(auto) raise ArgumentError, "The autosign configuration '#{auto}' must be a fully qualified file" unless auto =~ /^\// - return FileTest.exist?(auto) && auto + FileTest.exist?(auto) && auto end # Create an AuthStore for autosigning. @@ -165,7 +165,7 @@ class Puppet::SSL::CertificateAuthority @password = pass - return pass + pass end # List all signed certificates. @@ -190,7 +190,7 @@ class Puppet::SSL::CertificateAuthority f << "%04X" % (serial + 1) } - return serial + serial end # Does the password file exist? @@ -200,7 +200,7 @@ class Puppet::SSL::CertificateAuthority # Print a given host's certificate as text. def print(name) - return (cert = Puppet::SSL::Certificate.find(name)) ? cert.to_text : nil + (cert = Puppet::SSL::Certificate.find(name)) ? cert.to_text : nil end # Revoke a given certificate. @@ -254,7 +254,7 @@ class Puppet::SSL::CertificateAuthority # And remove the CSR if this wasn't self signed. Puppet::SSL::CertificateRequest.destroy(csr.name) unless self_signing_csr - return cert + cert end # Verify a given host's certificate. diff --git a/lib/puppet/ssl/certificate_factory.rb b/lib/puppet/ssl/certificate_factory.rb index 9273bb902..e794c770c 100644 --- a/lib/puppet/ssl/certificate_factory.rb +++ b/lib/puppet/ssl/certificate_factory.rb @@ -86,7 +86,7 @@ class Puppet::SSL::CertificateFactory raise ArgumentError, "Invalid ca_ttl #{ttl}" unless ttl =~ /^(\d+)(y|d|h|s)$/ - return $1.to_i * UNITMAP[$2] + $1.to_i * UNITMAP[$2] end def set_ttl diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb index 2b1db7e42..cfc40fd1f 100644 --- a/lib/puppet/ssl/host.rb +++ b/lib/puppet/ssl/host.rb @@ -150,7 +150,7 @@ class Puppet::SSL::Host raise end - return true + true end def certificate @@ -173,7 +173,7 @@ class Puppet::SSL::Host return false unless key return false unless certificate - return certificate.content.check_private_key(key.content) + certificate.content.check_private_key(key.content) end # Generate all necessary parts of our ssl host. diff --git a/lib/puppet/ssl/inventory.rb b/lib/puppet/ssl/inventory.rb index 38cbf46e9..6fb2ea8c2 100644 --- a/lib/puppet/ssl/inventory.rb +++ b/lib/puppet/ssl/inventory.rb @@ -20,7 +20,7 @@ class Puppet::SSL::Inventory # Format our certificate for output. def format(cert) iso = '%Y-%m-%dT%H:%M:%S%Z' - return "0x%04x %s %s %s\n" % [cert.serial, cert.not_before.strftime(iso), cert.not_after.strftime(iso), cert.subject] + "0x%04x %s %s %s\n" % [cert.serial, cert.not_before.strftime(iso), cert.not_after.strftime(iso), cert.subject] end def initialize diff --git a/lib/puppet/sslcertificates.rb b/lib/puppet/sslcertificates.rb index 2ce782293..02cb9fe03 100755 --- a/lib/puppet/sslcertificates.rb +++ b/lib/puppet/sslcertificates.rb @@ -106,7 +106,7 @@ module Puppet::SSLCertificates # for some reason this _must_ be the last extension added ex << ef.create_extension("authorityKeyIdentifier", "keyid:always,issuer:always") if hash[:type] == :ca - return cert + cert end def self.mkhash(dir, cert, certfile) @@ -137,7 +137,7 @@ module Puppet::SSLCertificates } - return hashpath + hashpath end require 'puppet/sslcertificates/certificate' require 'puppet/sslcertificates/inventory' diff --git a/lib/puppet/sslcertificates/ca.rb b/lib/puppet/sslcertificates/ca.rb index 22e14b9b9..e9e66bc61 100644 --- a/lib/puppet/sslcertificates/ca.rb +++ b/lib/puppet/sslcertificates/ca.rb @@ -86,7 +86,7 @@ class Puppet::SSLCertificates::CA rescue Errno::EACCES => detail raise Puppet::Error, detail.to_s end - return pass + pass end # Get the CA password. @@ -114,7 +114,7 @@ class Puppet::SSLCertificates::CA csrfile = host2csrfile(host) return nil unless File.exists?(csrfile) - return OpenSSL::X509::Request.new(File.read(csrfile)) + OpenSSL::X509::Request.new(File.read(csrfile)) end # Retrieve a client's certificate. @@ -122,7 +122,7 @@ class Puppet::SSLCertificates::CA certfile = host2certfile(host) return [nil, nil] unless File.exists?(certfile) - return [OpenSSL::X509::Certificate.new(File.read(certfile)), @cert] + [OpenSSL::X509::Certificate.new(File.read(certfile)), @cert] end # List certificates waiting to be signed. This returns a list of hostnames, not actual @@ -175,7 +175,7 @@ class Puppet::SSLCertificates::CA Puppet.settings.write(:capub) do |f| f.puts @cert.public_key end - return cert + cert end def removeclientcsr(host) @@ -258,7 +258,7 @@ class Puppet::SSLCertificates::CA self.storeclientcert(newcert) - return [newcert, @cert] + [newcert, @cert] end # Store the client's CSR for later signing. This is called from diff --git a/lib/puppet/sslcertificates/certificate.rb b/lib/puppet/sslcertificates/certificate.rb index e4278bc7a..1a5c31d18 100644 --- a/lib/puppet/sslcertificates/certificate.rb +++ b/lib/puppet/sslcertificates/certificate.rb @@ -29,7 +29,7 @@ class Puppet::SSLCertificates::Certificate end def exists? - return FileTest.exists?(@certfile) + FileTest.exists?(@certfile) end def getkey @@ -136,7 +136,7 @@ class Puppet::SSLCertificates::Certificate raise Puppet::Error, "CSR sign verification failed" unless @csr.verify(@key.public_key) - return @csr + @csr end def mkkey @@ -198,7 +198,7 @@ class Puppet::SSLCertificates::Certificate @cert.sign(@key, OpenSSL::Digest::SHA1.new) if @selfsign - return @cert + @cert end def subject(string = false) diff --git a/lib/puppet/sslcertificates/inventory.rb b/lib/puppet/sslcertificates/inventory.rb index 13f4e7f6a..c3f79ee6c 100644 --- a/lib/puppet/sslcertificates/inventory.rb +++ b/lib/puppet/sslcertificates/inventory.rb @@ -23,7 +23,7 @@ module Puppet::SSLCertificates Dir.glob(File::join(Puppet[:signeddir], "*.pem")) do |f| inv += format(OpenSSL::X509::Certificate.new(File::read(f))) + "\n" end - return inv + inv end def self.format(cert) diff --git a/lib/puppet/sslcertificates/support.rb b/lib/puppet/sslcertificates/support.rb index a32d9f00e..919d68664 100644 --- a/lib/puppet/sslcertificates/support.rb +++ b/lib/puppet/sslcertificates/support.rb @@ -114,7 +114,7 @@ module Puppet::SSLCertificates::Support end raise Puppet::DevError, "Received invalid certificate" unless @cert.check_private_key(@key) - return retrieved + retrieved end # A hack method to deal with files that exist with a different case. @@ -141,6 +141,6 @@ module Puppet::SSLCertificates::Support Puppet.notice "Fixing case in #{full_file}; renaming to #{file}" File.rename(full_file, file) - return true + true end end diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index bc2cc9c86..15ce5903b 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -175,7 +175,7 @@ class Puppet::Transaction found_failed = true end - return found_failed + found_failed end # A general method for recursively generating new resources from a @@ -225,7 +225,7 @@ class Puppet::Transaction # Generate a transaction report. def generate_report @report.calculate_metrics - return @report + @report end # Should we ignore tags? @@ -331,7 +331,7 @@ class Puppet::Transaction else return false end - return true + true end # The tags we should be checking. diff --git a/lib/puppet/transaction/change.rb b/lib/puppet/transaction/change.rb index 18f11c016..0f2ed5788 100644 --- a/lib/puppet/transaction/change.rb +++ b/lib/puppet/transaction/change.rb @@ -50,7 +50,7 @@ class Puppet::Transaction::Change # Is our property noop? This is used for generating special events. def noop? - return @property.noop + @property.noop end # The resource that generated this change. This is used for handling events, @@ -63,7 +63,7 @@ class Puppet::Transaction::Change end def to_s - return "change #{@property.change_to_s(@is, @should)}" + "change #{@property.change_to_s(@is, @should)}" end private @@ -74,7 +74,7 @@ class Puppet::Transaction::Change result.message = "audit change: previously recorded value #{property.should_to_s(should)} has been changed to #{property.is_to_s(is)}" result.status = "audit" result.send_log - return result + result end def noop_event @@ -82,6 +82,6 @@ class Puppet::Transaction::Change result.message = "is #{property.is_to_s(is)}, should be #{property.should_to_s(should)} (noop)" result.status = "noop" result.send_log - return result + result end end diff --git a/lib/puppet/transaction/report.rb b/lib/puppet/transaction/report.rb index f9dfab3a3..021c0200a 100644 --- a/lib/puppet/transaction/report.rb +++ b/lib/puppet/transaction/report.rb @@ -20,7 +20,7 @@ class Puppet::Transaction::Report def <<(msg) @logs << msg - return self + self end def add_times(name, value) @@ -83,7 +83,7 @@ class Puppet::Transaction::Report ret += " %15s %s\n" % [label + ":", value] end end - return ret + ret end # Based on the contents of this report's metrics, compute a single number @@ -93,7 +93,7 @@ class Puppet::Transaction::Report status = 0 status |= 2 if @metrics["changes"][:total] > 0 status |= 4 if @metrics["resources"][:failed] > 0 - return status + status end private diff --git a/lib/puppet/transaction/resource_harness.rb b/lib/puppet/transaction/resource_harness.rb index 36bb6029d..5f90df5b9 100644 --- a/lib/puppet/transaction/resource_harness.rb +++ b/lib/puppet/transaction/resource_harness.rb @@ -13,7 +13,7 @@ class Puppet::Transaction::ResourceHarness deplabel = deps.collect { |r| r.ref }.join(",") plurality = deps.length > 1 ? "":"s" resource.warning "#{deplabel} still depend#{plurality} on me -- not purging" - return false + false end def apply_changes(status, changes) @@ -117,7 +117,7 @@ class Puppet::Transaction::ResourceHarness # have been synced a long time ago (e.g., a file only gets updated # once a month on the server and its schedule is daily; the last sync time # will have been a month ago, so we'd end up checking every run). - return schedule.match?(cached(resource, :checked).to_i) + schedule.match?(cached(resource, :checked).to_i) end def schedule(resource) diff --git a/lib/puppet/transportable.rb b/lib/puppet/transportable.rb index 876a8a222..c0b3edcfc 100644 --- a/lib/puppet/transportable.rb +++ b/lib/puppet/transportable.rb @@ -30,7 +30,7 @@ module Puppet end def longname - return [@type,@name].join('--') + [@type,@name].join('--') end def ref @@ -39,7 +39,7 @@ module Puppet end def tags - return @tags + @tags end # Convert a defined type into a component. @@ -59,7 +59,7 @@ module Puppet end def to_s - return "#{@type}(#{@name}) => #{super}" + "#{@type}(#{@name}) => #{super}" end def to_manifest @@ -210,7 +210,7 @@ module Puppet raise end - return catalog + catalog end def to_ref diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index e2445b1d2..f84abd449 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -113,7 +113,7 @@ class Type set &&= self.public_method_defined?(method) } - return ens + ens end # Deal with any options passed into parameters. @@ -173,7 +173,7 @@ class Type param.metaparam = true - return param + param end def self.key_attribute_parameters @@ -226,7 +226,7 @@ class Type param.isnamevar if options[:namevar] - return param + param end def self.newstate(name, options = {}, &block) @@ -280,7 +280,7 @@ class Type @properties << prop end - return prop + prop end def self.paramdoc(param) @@ -318,20 +318,20 @@ class Type # does the name reflect a valid property? def self.validproperty?(name) name = symbolize(name) - return @validproperties.include?(name) && @validproperties[name] + @validproperties.include?(name) && @validproperties[name] end # Return the list of validproperties def self.validproperties return {} unless defined?(@parameters) - return @validproperties.keys + @validproperties.keys end # does the name reflect a valid parameter? def self.validparameter?(name) raise Puppet::DevError, "Class #{self} has not defined parameters" unless defined?(@parameters) - return !!(@paramhash.include?(name) or @@metaparamhash.include?(name)) + !!(@paramhash.include?(name) or @@metaparamhash.include?(name)) end # This is a forward-compatibility method - it's the validity interface we'll use in Puppet::Resource. @@ -361,7 +361,7 @@ class Type self.newattr(prop_name) return true end - return false + false end # @@ -456,7 +456,7 @@ class Type # retrieve the 'should' value for a specified property def should(name) name = attr_alias(name) - return (prop = @parameters[name] and prop.is_a?(Puppet::Property)) ? prop.should : nil + (prop = @parameters[name] and prop.is_a?(Puppet::Property)) ? prop.should : nil end # Create the actual attribute instance. Requires either the attribute @@ -474,7 +474,7 @@ class Type return @parameters[name] if @parameters.include?(name) - return @parameters[name] = klass.new(:resource => self) + @parameters[name] = klass.new(:resource => self) end # return the value of a parameter @@ -489,14 +489,14 @@ class Type # Is the named property defined? def propertydefined?(name) name = name.intern unless name.is_a? Symbol - return @parameters.include?(name) + @parameters.include?(name) end # Return an actual property instance by name; to return the value, use 'resource[param]' # LAK:NOTE(20081028) Since the 'parameter' method is now a superset of this method, # this one should probably go away at some point. def property(name) - return (obj = @parameters[symbolize(name)] and obj.is_a?(Puppet::Property)) ? obj : nil + (obj = @parameters[symbolize(name)] and obj.is_a?(Puppet::Property)) ? obj : nil end # For any parameters or properties that have defaults and have not yet been @@ -535,7 +535,7 @@ class Type def value(name) name = attr_alias(name) - return (obj = @parameters[name] and obj.respond_to?(:value)) ? obj.value : nil + (obj = @parameters[name] and obj.respond_to?(:value)) ? obj.value : nil end def version @@ -593,7 +593,7 @@ class Type # this is a retarded hack method to get around the difference between # component children and file children def self.depthfirst? - return defined?(@depthfirst) && @depthfirst + defined?(@depthfirst) && @depthfirst end def depthfirst? @@ -661,7 +661,7 @@ class Type } #self.debug("#{self} sync status is #{insync}") - return insync + insync end # retrieve the current value of all contained properties @@ -840,7 +840,7 @@ class Type # does the type have an object with the given name? def self.has_key?(name) raise "Global resource access is deprecated" - return @objects.has_key?(name) + @objects.has_key?(name) end # Retrieve all known instances. Either requires providers or must be overridden. @@ -899,7 +899,7 @@ class Type hash.each do |param, value| resource[param] = value end - return resource + resource end # Create the path for logging and such. @@ -1354,7 +1354,7 @@ class Type @defaultprovider = retval end - return @defaultprovider + @defaultprovider end def self.provider_hash_by_type(type) @@ -1372,7 +1372,7 @@ class Type # If we don't have it yet, try loading it. @providerloader.load(name) unless provider_hash.has_key?(name) - return provider_hash[name] + provider_hash[name] end # Just list all of the providers. @@ -1383,7 +1383,7 @@ class Type def self.validprovider?(name) name = Puppet::Util.symbolize(name) - return (provider_hash.has_key?(name) && provider_hash[name].suitable?) + (provider_hash.has_key?(name) && provider_hash[name].suitable?) end # Create a new provider of a type. This method must be called @@ -1429,7 +1429,7 @@ class Type :attributes => options ) - return provider + provider end # Make sure we have a :provider parameter defined. Only gets called if there @@ -1569,7 +1569,7 @@ class Type } } - return reqs + reqs end # Build the dependencies associated with an individual object. @@ -1778,7 +1778,7 @@ class Type # For now, leave the 'name' method functioning like it used to. Once 'title' # works everywhere, I'll switch it. def name - return self[:name] + self[:name] end # Look up our parent in the catalog, if we have one. @@ -1834,7 +1834,7 @@ class Type end end - return @title + @title end # convert to a string @@ -1865,7 +1865,7 @@ class Type # FIXME I'm currently ignoring 'parent' and 'path' - return trans + trans end def to_resource diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb index 0a83865c8..ae8f1a525 100644 --- a/lib/puppet/type/augeas.rb +++ b/lib/puppet/type/augeas.rb @@ -160,7 +160,7 @@ Puppet::Type.newtype(:augeas) do # Make output a bit prettier def change_to_s(currentvalue, newvalue) - return "executed successfully" + "executed successfully" end # if the onlyif resource is provided, then the value is parsed. diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb index 3f6448bce..9d5d2f45d 100755 --- a/lib/puppet/type/cron.rb +++ b/lib/puppet/type/cron.rb @@ -77,7 +77,7 @@ Puppet::Type.newtype(:cron) do # Verify that a number is within the specified limits. Return the # number if it is, or false if it is not. def limitcheck(num, lower, upper) - return (num >= lower and num <= upper) && num + (num >= lower and num <= upper) && num end # Verify that a value falls within the specified array. Does case @@ -98,7 +98,7 @@ Puppet::Type.newtype(:cron) do return ary.index(tmp) if ary.include?(tmp) end - return false + false end def should_to_s(newvalue = @should) @@ -213,7 +213,7 @@ Puppet::Type.newtype(:cron) do return_value = super return_value = return_value[0] if return_value && return_value.is_a?(Array) - return return_value + return_value end def should diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index ee1ed9952..f930a536c 100755 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -88,7 +88,7 @@ module Puppet # Make output a bit prettier def change_to_s(currentvalue, newvalue) - return "executed successfully" + "executed successfully" end # First verify that all of our checks pass. @@ -150,7 +150,7 @@ module Puppet self.fail("#{self.resource[:command]} returned #{@status.exitstatus} instead of one of [#{self.should.join(",")}]") end - return event + event end end @@ -391,7 +391,7 @@ module Puppet # If the file exists, return false (i.e., don't run the command), # else return true def check(value) - return ! FileTest.exists?(value) + ! FileTest.exists?(value) end end @@ -428,7 +428,7 @@ module Puppet return false end - return status.exitstatus != 0 + status.exitstatus != 0 end end @@ -470,7 +470,7 @@ module Puppet return false end - return status.exitstatus == 0 + status.exitstatus == 0 end end @@ -543,7 +543,7 @@ module Puppet end } - return true + true end # Verify that we have the executable diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index aeb651ffd..a823ea9a5 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -326,7 +326,7 @@ Puppet::Type.newtype(:file) do asuser = self.should(:owner) if writeable end - return asuser + asuser end def bucket @@ -348,7 +348,7 @@ Puppet::Type.newtype(:file) do @bucket = filebucket.bucket - return @bucket + @bucket end def default_bucket @@ -438,7 +438,7 @@ Puppet::Type.newtype(:file) do options.delete(param) if options.include?(param) end - return self.class.new(options) + self.class.new(options) end # Files handle paths specially, because they just lengthen their @@ -514,7 +514,7 @@ Puppet::Type.newtype(:file) do val = @parameters[:recurse].value - return !!(val and (val == true or val == :remote)) + !!(val and (val == true or val == :remote)) end # Recurse the target of the link. @@ -668,7 +668,7 @@ Puppet::Type.newtype(:file) do # If we've gotten here, then :ensure isn't set return true if self[:content] return true if stat and stat.ftype == "file" - return false + false end # Stat our file. Depending on the value of the 'links' attribute, we diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb index 7f9729292..472fdb443 100755 --- a/lib/puppet/type/file/content.rb +++ b/lib/puppet/type/file/content.rb @@ -105,7 +105,7 @@ module Puppet print diff(@resource[:path], path) end end - return result + result end def retrieve @@ -136,7 +136,7 @@ module Puppet # one valid value somewhere. @resource.write(:content) - return return_event + return_event end def write_temporarily diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb index a1152c027..a6eed8a1d 100755 --- a/lib/puppet/type/file/ensure.rb +++ b/lib/puppet/type/file/ensure.rb @@ -113,7 +113,7 @@ module Puppet is = :absent end - return property.change_to_s(is, should) + property.change_to_s(is, should) end # Check that we can actually create anything @@ -163,7 +163,7 @@ module Puppet event = super - return event + event end end end diff --git a/lib/puppet/type/file/group.rb b/lib/puppet/type/file/group.rb index a5129ae25..b00eb23e3 100755 --- a/lib/puppet/type/file/group.rb +++ b/lib/puppet/type/file/group.rb @@ -58,7 +58,7 @@ module Puppet return true if gid == current end - return false + false end def retrieve @@ -74,7 +74,7 @@ module Puppet currentvalue = :silly end - return currentvalue + currentvalue end # Determine if the group is valid, and if so, return the GID @@ -107,7 +107,7 @@ module Puppet error = Puppet::Error.new( "failed to chgrp #{resource[:path]} to #{gid}: #{detail.message}") raise error end - return :file_changed + :file_changed end end end diff --git a/lib/puppet/type/file/mode.rb b/lib/puppet/type/file/mode.rb index 6a73822f0..d38157b7d 100755 --- a/lib/puppet/type/file/mode.rb +++ b/lib/puppet/type/file/mode.rb @@ -81,7 +81,7 @@ module Puppet value |= 01 if value & 04 != 0 end - return value + value end def insync?(currentvalue) @@ -117,7 +117,7 @@ module Puppet error.set_backtrace detail.backtrace raise error end - return :file_changed + :file_changed end end end diff --git a/lib/puppet/type/file/owner.rb b/lib/puppet/type/file/owner.rb index 05754efcc..01c092382 100755 --- a/lib/puppet/type/file/owner.rb +++ b/lib/puppet/type/file/owner.rb @@ -41,11 +41,11 @@ module Puppet end end end - return provider.retrieve(@resource) + provider.retrieve(@resource) end def sync - return provider.sync(resource[:path], resource[:links], @should) + provider.sync(resource[:path], resource[:links], @should) end end end diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb index 71ce30133..0a889fc3e 100644 --- a/lib/puppet/type/file/selcontext.rb +++ b/lib/puppet/type/file/selcontext.rb @@ -28,7 +28,7 @@ module Puppet def retrieve return :absent unless @resource.stat(false) context = self.get_selinux_current_context(@resource[:path]) - return parse_selinux_context(name, context) + parse_selinux_context(name, context) end def retrieve_default_context(property) @@ -37,7 +37,7 @@ module Puppet end property_default = self.parse_selinux_context(property, context) self.debug "Found #{property} default '#{property_default}' for #{@resource[:path]}" if not property_default.nil? - return property_default + property_default end def insync?(value) @@ -50,7 +50,7 @@ module Puppet def sync self.set_selinux_context(@resource[:path], @should, name) - return :file_changed + :file_changed end end diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb index 9d1766c52..0053693f4 100755 --- a/lib/puppet/type/file/source.rb +++ b/lib/puppet/type/file/source.rb @@ -169,7 +169,7 @@ module Puppet end def full_path - return URI.unescape(uri.path) if found? and uri + URI.unescape(uri.path) if found? and uri end def server diff --git a/lib/puppet/type/file/type.rb b/lib/puppet/type/file/type.rb index 19816a20a..95470bb28 100755 --- a/lib/puppet/type/file/type.rb +++ b/lib/puppet/type/file/type.rb @@ -14,7 +14,7 @@ module Puppet end # so this state is never marked out of sync @should = [currentvalue] - return currentvalue + currentvalue end diff --git a/lib/puppet/type/filebucket.rb b/lib/puppet/type/filebucket.rb index dd6d1d63e..cc3474b40 100755 --- a/lib/puppet/type/filebucket.rb +++ b/lib/puppet/type/filebucket.rb @@ -62,7 +62,7 @@ module Puppet def bucket mkbucket() unless defined?(@bucket) - return @bucket + @bucket end private diff --git a/lib/puppet/type/group.rb b/lib/puppet/type/group.rb index aa5031f0c..7cf031a73 100755 --- a/lib/puppet/type/group.rb +++ b/lib/puppet/type/group.rb @@ -34,7 +34,7 @@ module Puppet GID is picked according to local system standards." def retrieve - return provider.gid + provider.gid end def sync diff --git a/lib/puppet/type/host.rb b/lib/puppet/type/host.rb index 0b830158c..bd7d4bde8 100755 --- a/lib/puppet/type/host.rb +++ b/lib/puppet/type/host.rb @@ -40,7 +40,7 @@ module Puppet else raise Puppet::DevError, "Invalid @is type #{is.class}" end - return is + is end # We actually want to return the whole array here, not just the first diff --git a/lib/puppet/type/notify.rb b/lib/puppet/type/notify.rb index bbb48d67b..d46ade7a5 100644 --- a/lib/puppet/type/notify.rb +++ b/lib/puppet/type/notify.rb @@ -19,7 +19,7 @@ module Puppet end def retrieve - return :absent + :absent end def insync?(is) diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index 6c5b0702b..fdcd2c80c 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -158,12 +158,12 @@ module Puppet end } - return false + false end # This retrieves the current state. LAK: I think this method is unused. def retrieve - return provider.properties[:ensure] + provider.properties[:ensure] end # Provide a bit more information when logging upgrades. diff --git a/lib/puppet/type/resources.rb b/lib/puppet/type/resources.rb index a301c9bd5..2960998c9 100644 --- a/lib/puppet/type/resources.rb +++ b/lib/puppet/type/resources.rb @@ -127,7 +127,7 @@ Puppet::Type.newtype(:resources) do return false if system_users().include?(resource[:name]) - return current_values[resource.property(:uid)] > self[:unless_system_user] + current_values[resource.property(:uid)] > self[:unless_system_user] end def system_users diff --git a/lib/puppet/type/schedule.rb b/lib/puppet/type/schedule.rb index dcc7359e2..f66b5b0ad 100755 --- a/lib/puppet/type/schedule.rb +++ b/lib/puppet/type/schedule.rb @@ -173,7 +173,7 @@ module Puppet # Else, return false, since our current time isn't between # any valid times - return false + false end end @@ -345,7 +345,7 @@ module Puppet # If we haven't returned false, then return true; in other words, # any provided schedules need to all match - return true + true end end end diff --git a/lib/puppet/type/service.rb b/lib/puppet/type/service.rb index d2ba82afd..e1a2685a1 100644 --- a/lib/puppet/type/service.rb +++ b/lib/puppet/type/service.rb @@ -45,7 +45,7 @@ module Puppet end def retrieve - return provider.enabled? + provider.enabled? end end @@ -65,7 +65,7 @@ module Puppet aliasvalue(:true, :running) def retrieve - return provider.status + provider.status end def sync @@ -76,7 +76,7 @@ module Puppet property.sync unless property.insync?(val) end - return event + event end end diff --git a/lib/puppet/type/sshkey.rb b/lib/puppet/type/sshkey.rb index 7dc627c75..6051a52d2 100755 --- a/lib/puppet/type/sshkey.rb +++ b/lib/puppet/type/sshkey.rb @@ -35,7 +35,7 @@ module Puppet # We actually want to return the whole array here, not just the first # value. def should - return defined?(@should) ? @should : nil + defined?(@should) ? @should : nil end validate do |value| diff --git a/lib/puppet/type/tidy.rb b/lib/puppet/type/tidy.rb index 1f7ae46a0..6923b455c 100755 --- a/lib/puppet/type/tidy.rb +++ b/lib/puppet/type/tidy.rb @@ -117,7 +117,7 @@ Puppet::Type.newtype(:tidy) do def tidy?(path, stat) # If the file's older than we allow, we should get rid of it. - return (Time.now.to_i - stat.send(resource[:type]).to_i) > value + (Time.now.to_i - stat.send(resource[:type]).to_i) > value end munge do |age| @@ -162,7 +162,7 @@ Puppet::Type.newtype(:tidy) do end def tidy?(path, stat) - return stat.size >= value + stat.size >= value end munge do |size| @@ -276,7 +276,7 @@ Puppet::Type.newtype(:tidy) do end end - return result + result end # Does a given path match our glob patterns, if any? Return true @@ -313,7 +313,7 @@ Puppet::Type.newtype(:tidy) do # If they don't specify either, then the file should always be removed. return true unless tested - return false + false end def stat(path) diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index 1746baab0..9e5afe083 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -108,7 +108,7 @@ module Puppet return true if number = Puppet::Util.gid(value) and is == number end - return false + false end def sync diff --git a/lib/puppet/type/yumrepo.rb b/lib/puppet/type/yumrepo.rb index aa685f033..b85bc5994 100644 --- a/lib/puppet/type/yumrepo.rb +++ b/lib/puppet/type/yumrepo.rb @@ -10,7 +10,7 @@ module Puppet if is.nil? && (should.nil? || should == :absent) return true end - return super(is) + super(is) end def sync @@ -24,11 +24,11 @@ module Puppet resource.section[inikey] = should end end - return result + result end def retrieve - return resource.section[inikey] + resource.section[inikey] end def inikey @@ -121,7 +121,7 @@ module Puppet end end end - return @inifile + @inifile end # Parse the yum config files. Only exposed for the tests @@ -148,7 +148,7 @@ module Puppet end end end - return result + result end # Return the Puppet::Util::IniConfig::Section with name NAME @@ -162,7 +162,7 @@ module Puppet Puppet::info "create new repo #{name} in file #{path}" result = inifile.add_section(name, path) end - return result + result end # Store all modifications back to disk diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb index d4d9c9e9c..e853efcae 100644 --- a/lib/puppet/type/zone.rb +++ b/lib/puppet/type/zone.rb @@ -172,7 +172,7 @@ Puppet::Type.newtype(:zone) do end end - return ("zone_#{self.should}").intern + ("zone_#{self.should}").intern end # Are we moving up the property tree? @@ -441,6 +441,6 @@ Puppet::Type.newtype(:zone) do self[param] = value end end - return prophash + prophash end end diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index e7b4f24f7..a123d9740 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -23,7 +23,7 @@ module Util # Return the sync object associated with a given resource. def self.sync(resource) @@syncresources[resource] ||= Sync.new - return @@syncresources[resource] + @@syncresources[resource] end # Change the process to a different user @@ -190,7 +190,7 @@ module Util return dest if FileTest.file? dest and FileTest.executable? dest end end - return nil + nil end module_function :binary @@ -212,7 +212,7 @@ module Util end end - return output + output end def execfail(command, exception) @@ -346,7 +346,7 @@ module Util end end - return output + output end module_function :execute @@ -406,7 +406,7 @@ module Util end end - return hash + hash end module_function :symbolize, :symbolizehash, :symbolizehash! @@ -416,7 +416,7 @@ module Util yield } - return seconds + seconds end module_function :memory, :thinmark diff --git a/lib/puppet/util/autoload/file_cache.rb b/lib/puppet/util/autoload/file_cache.rb index 44d988969..7303c9a1c 100644 --- a/lib/puppet/util/autoload/file_cache.rb +++ b/lib/puppet/util/autoload/file_cache.rb @@ -59,7 +59,7 @@ module Puppet::Util::Autoload::FileCache end def missing_file?(path) - return !!(time = missing_files[path] and ! data_expired?(time)) + !!(time = missing_files[path] and ! data_expired?(time)) end def missing_file(path) diff --git a/lib/puppet/util/cacher.rb b/lib/puppet/util/cacher.rb index bcd4c1bc1..d229c40ca 100644 --- a/lib/puppet/util/cacher.rb +++ b/lib/puppet/util/cacher.rb @@ -12,7 +12,7 @@ module Puppet::Util::Cacher def dependent_data_expired?(ts) return false unless timestamp - return timestamp > ts + timestamp > ts end end @@ -108,7 +108,7 @@ module Puppet::Util::Cacher if expirer.nil? return true unless self.class.attr_ttl(name) end - return expirer.dependent_data_expired?(cache_timestamp) + expirer.dependent_data_expired?(cache_timestamp) end def expired_by_ttl?(name) @@ -118,7 +118,7 @@ module Puppet::Util::Cacher @ttl_timestamps ||= {} @ttl_timestamps[name] ||= Time.now - return (Time.now - @ttl_timestamps[name]) > ttl + (Time.now - @ttl_timestamps[name]) > ttl end def value_cache diff --git a/lib/puppet/util/checksums.rb b/lib/puppet/util/checksums.rb index 7b3ef6e15..a05cc0e4f 100644 --- a/lib/puppet/util/checksums.rb +++ b/lib/puppet/util/checksums.rb @@ -8,12 +8,12 @@ module Puppet::Util::Checksums # Strip the checksum type from an existing checksum def sumdata(checksum) - return checksum =~ /^\{(\w+)\}(.+)/ ? $2 : nil + checksum =~ /^\{(\w+)\}(.+)/ ? $2 : nil end # Strip the checksum type from an existing checksum def sumtype(checksum) - return checksum =~ /^\{(\w+)\}/ ? $1 : nil + checksum =~ /^\{(\w+)\}/ ? $1 : nil end # Calculate a checksum using Digest::MD5. @@ -32,7 +32,7 @@ module Puppet::Util::Checksums require 'digest/md5' digest = Digest::MD5.new() - return checksum_file(digest, filename, lite) + checksum_file(digest, filename, lite) end # Calculate a checksum of the first 500 chars of a file's content using Digest::MD5. @@ -44,7 +44,7 @@ module Puppet::Util::Checksums require 'digest/md5' digest = Digest::MD5.new() yield digest - return digest.hexdigest + digest.hexdigest end alias :md5lite_stream :md5_stream @@ -77,7 +77,7 @@ module Puppet::Util::Checksums require 'digest/sha1' digest = Digest::SHA1.new() - return checksum_file(digest, filename, lite) + checksum_file(digest, filename, lite) end # Calculate a checksum of the first 500 chars of a file's content using Digest::SHA1. @@ -89,7 +89,7 @@ module Puppet::Util::Checksums require 'digest/sha1' digest = Digest::SHA1.new() yield digest - return digest.hexdigest + digest.hexdigest end alias :sha1lite_stream :sha1_stream @@ -120,6 +120,6 @@ module Puppet::Util::Checksums end end - return digest.hexdigest + digest.hexdigest end end diff --git a/lib/puppet/util/classgen.rb b/lib/puppet/util/classgen.rb index d4c693e1e..92fcc6724 100644 --- a/lib/puppet/util/classgen.rb +++ b/lib/puppet/util/classgen.rb @@ -63,7 +63,7 @@ module Puppet::Util::ClassGen end # Let them know whether we did actually delete a subclass. - return retval + retval end private @@ -75,7 +75,7 @@ module Puppet::Util::ClassGen const = prefix + name2const(name) end - return const + const end # This does the actual work of creating our class or module. It's just a @@ -121,7 +121,7 @@ module Puppet::Util::ClassGen # Store the class in hashes or arrays or whatever. storeclass(klass, name, options) - return klass + klass end # Handle the setting and/or removing of the associated constant. @@ -139,7 +139,7 @@ module Puppet::Util::ClassGen end const_set(const, klass) - return const + const end # Perform the initializations on the class. diff --git a/lib/puppet/util/errors.rb b/lib/puppet/util/errors.rb index 3aa65d06c..6fa14d3df 100644 --- a/lib/puppet/util/errors.rb +++ b/lib/puppet/util/errors.rb @@ -12,7 +12,7 @@ module Puppet::Util::Errors error.set_backtrace other.backtrace if other and other.respond_to?(:backtrace) - return error + error end def error_context @@ -44,7 +44,7 @@ module Puppet::Util::Errors raise adderrorcontext(error, detail) end - return retval + retval end # Throw an error, defaulting to a Puppet::Error. diff --git a/lib/puppet/util/feature.rb b/lib/puppet/util/feature.rb index 8e2f81fa4..99587a06b 100644 --- a/lib/puppet/util/feature.rb +++ b/lib/puppet/util/feature.rb @@ -48,7 +48,7 @@ class Puppet::Util::Feature feature = method.to_s.sub(/\?$/, '') @loader.load(feature) - return respond_to?(method) && self.send(method) + respond_to?(method) && self.send(method) end # Actually test whether the feature is present. We only want to test when @@ -63,7 +63,7 @@ class Puppet::Util::Feature end # We loaded all of the required libraries - return true + true end private @@ -79,6 +79,6 @@ class Puppet::Util::Feature Puppet.debug "Failed to load library '#{lib}' for feature '#{name}'" return false end - return true + true end end diff --git a/lib/puppet/util/fileparsing.rb b/lib/puppet/util/fileparsing.rb index c8ab53d6a..a5d7ca4ab 100644 --- a/lib/puppet/util/fileparsing.rb +++ b/lib/puppet/util/fileparsing.rb @@ -137,7 +137,7 @@ module Puppet::Util::FileParsing # Try to match a specific text line. def handle_text_line(line, record) - return line =~ record.match ? {:record_type => record.name, :line => line} : nil + line =~ record.match ? {:record_type => record.name, :line => line} : nil end # Try to match a record. @@ -248,7 +248,7 @@ module Puppet::Util::FileParsing end end - return nil + nil end # Define a new type of record. These lines get split into hashes. Valid @@ -295,7 +295,7 @@ module Puppet::Util::FileParsing text += line_separator if trailing_separator - return text + text end # Convert our parsed record into a text record. @@ -362,7 +362,7 @@ module Puppet::Util::FileParsing @record_types[record.name] = record @record_order << record - return record + record end # Retrieve the record object. diff --git a/lib/puppet/util/inifile.rb b/lib/puppet/util/inifile.rb index 3488ce54d..276f741c5 100644 --- a/lib/puppet/util/inifile.rb +++ b/lib/puppet/util/inifile.rb @@ -71,7 +71,7 @@ module Puppet::Util::IniConfig text << entry end end - return text + text end private @@ -79,7 +79,7 @@ module Puppet::Util::IniConfig @entries.each do |entry| return entry if entry.is_a?(Array) && entry[0] == key end - return nil + nil end end @@ -182,12 +182,12 @@ module Puppet::Util::IniConfig each_section do |section| return section if section.name == name end - return nil + nil end # Return true if the file contains a section with name NAME def include?(name) - return ! self[name].nil? + ! self[name].nil? end # Add a section to be stored in FILE when store is called @@ -196,7 +196,7 @@ module Puppet::Util::IniConfig result = Section.new(name, file) @files[file] ||= [] @files[file] << result - return result + result end end end diff --git a/lib/puppet/util/ldap/generator.rb b/lib/puppet/util/ldap/generator.rb index 2a868b0d9..fb4915100 100644 --- a/lib/puppet/util/ldap/generator.rb +++ b/lib/puppet/util/ldap/generator.rb @@ -7,7 +7,7 @@ class Puppet::Util::Ldap::Generator # Declare the attribute we'll use to generate the value. def from(source) @source = source - return self + self end # Actually do the generation. @@ -40,6 +40,6 @@ class Puppet::Util::Ldap::Generator # Provide the code that does the generation. def with(&block) @generator = block - return self + self end end diff --git a/lib/puppet/util/ldap/manager.rb b/lib/puppet/util/ldap/manager.rb index 93e8baac3..b1048a1a3 100644 --- a/lib/puppet/util/ldap/manager.rb +++ b/lib/puppet/util/ldap/manager.rb @@ -9,13 +9,13 @@ class Puppet::Util::Ldap::Manager # A null-op that just returns the config. def and - return self + self end # Set the offset from the search base and return the config. def at(location) @location = location - return self + self end # The basic search base. @@ -69,7 +69,7 @@ class Puppet::Util::Ldap::Manager ensure @connection.close end - return nil + nil end # Convert the name to a dn, then pass the args along to @@ -160,7 +160,7 @@ class Puppet::Util::Ldap::Manager # Specify what classes this provider models. def manages(*classes) @objectclasses = classes - return self + self end # Specify the attribute map. Assumes the keys are the puppet @@ -173,7 +173,7 @@ class Puppet::Util::Ldap::Manager # and the ldap attributes as the keys. @ldap2puppet = attributes.inject({}) { |map, ary| map[ary[1]] = ary[0]; map } - return self + self end # Return the ldap name for a puppet attribute. diff --git a/lib/puppet/util/loadedfile.rb b/lib/puppet/util/loadedfile.rb index 3dd8151a4..22d8928e7 100755 --- a/lib/puppet/util/loadedfile.rb +++ b/lib/puppet/util/loadedfile.rb @@ -54,7 +54,7 @@ module Puppet @stamp = Time.now end end - return @stamp + @stamp end def to_s diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb index 16a4eb239..e841c7add 100644 --- a/lib/puppet/util/log.rb +++ b/lib/puppet/util/log.rb @@ -26,7 +26,7 @@ class Puppet::Util::Log ) dest.match(dest.name) - return dest + dest end require 'puppet/util/log/destination' @@ -71,7 +71,7 @@ class Puppet::Util::Log def Log.create(hash) raise Puppet::DevError, "Logs require a level" unless hash.include?(:level) raise Puppet::DevError, "Invalid log level #{hash[:level]}" unless @levels.index(hash[:level]) - return @levels.index(hash[:level]) >= @loglevel ? Puppet::Util::Log.new(hash) : nil + @levels.index(hash[:level]) >= @loglevel ? Puppet::Util::Log.new(hash) : nil end def Log.destinations @@ -85,7 +85,7 @@ class Puppet::Util::Log # Return the current log level. def Log.level - return @levels[@loglevel] + @levels[@loglevel] end # Set the current log level. diff --git a/lib/puppet/util/log/destination.rb b/lib/puppet/util/log/destination.rb index 81baa9301..35565b4a8 100644 --- a/lib/puppet/util/log/destination.rb +++ b/lib/puppet/util/log/destination.rb @@ -25,7 +25,7 @@ class Puppet::Util::Log::Destination # Search for direct matches or class matches return true if thing === obj or thing == obj.class.to_s end - return false + false end def name diff --git a/lib/puppet/util/log_paths.rb b/lib/puppet/util/log_paths.rb index 3132238e2..a7ad18906 100644 --- a/lib/puppet/util/log_paths.rb +++ b/lib/puppet/util/log_paths.rb @@ -7,7 +7,7 @@ module Puppet::Util::LogPaths def path @path = pathbuilder unless defined?(@path) - return "/" + @path.join("/") + "/" + @path.join("/") end def source_descriptors @@ -20,7 +20,7 @@ module Puppet::Util::LogPaths descriptors[param] = value end - return descriptors + descriptors end end diff --git a/lib/puppet/util/logging.rb b/lib/puppet/util/logging.rb index fa50efa0a..e514affd0 100644 --- a/lib/puppet/util/logging.rb +++ b/lib/puppet/util/logging.rb @@ -35,6 +35,6 @@ module Puppet::Util::Logging def log_source # We need to guard the existence of the constants, since this module is used by the base Puppet module. (is_resource? or is_resource_parameter?) and respond_to?(:path) and return path.to_s - return to_s + to_s end end diff --git a/lib/puppet/util/metric.rb b/lib/puppet/util/metric.rb index 6f5b2cf9b..eb25d7746 100644 --- a/lib/puppet/util/metric.rb +++ b/lib/puppet/util/metric.rb @@ -105,7 +105,7 @@ class Puppet::Util::Metric end def path - return File.join(self.basedir, @name + ".rrd") + File.join(self.basedir, @name + ".rrd") end def newvalue(name,value,label = nil) diff --git a/lib/puppet/util/package.rb b/lib/puppet/util/package.rb index 24df1c727..ecac77806 100644 --- a/lib/puppet/util/package.rb +++ b/lib/puppet/util/package.rb @@ -24,7 +24,7 @@ module Puppet::Util::Package return a.upcase <=> b.upcase end end - return version_a <=> version_b; + version_a <=> version_b; end module_function :versioncmp diff --git a/lib/puppet/util/posix.rb b/lib/puppet/util/posix.rb index c71a846d9..6bb94b01f 100755 --- a/lib/puppet/util/posix.rb +++ b/lib/puppet/util/posix.rb @@ -55,7 +55,7 @@ module Puppet::Util::POSIX when :passwd; Etc.send(:endpwent) when :group; Etc.send(:endgrent) end - return nil + nil end # Determine what the field name is for users and groups. diff --git a/lib/puppet/util/provider_features.rb b/lib/puppet/util/provider_features.rb index 37f11aa12..e0f90aebe 100644 --- a/lib/puppet/util/provider_features.rb +++ b/lib/puppet/util/provider_features.rb @@ -42,7 +42,7 @@ module Puppet::Util::ProviderFeatures return false unless obj.respond_to?(m) end end - return true + true end end diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb index cc767fa05..c79adf671 100644 --- a/lib/puppet/util/rdoc/parser.rb +++ b/lib/puppet/util/rdoc/parser.rb @@ -69,7 +69,7 @@ class Parser container = find_object_named(container, name) container = prev_container.add_class(PuppetClass, name, nil) unless container end - return [container, final_name] + [container, final_name] end # split_module tries to find if +path+ belongs to the module path @@ -105,7 +105,7 @@ class Parser end # we are under a global manifests Puppet.debug "rdoc: global manifests" - return "<site>" + "<site>" end # create documentation for the top level +container+ diff --git a/lib/puppet/util/reference.rb b/lib/puppet/util/reference.rb index 314f9c136..24da1e5d7 100644 --- a/lib/puppet/util/reference.rb +++ b/lib/puppet/util/reference.rb @@ -116,7 +116,7 @@ class Puppet::Util::Reference end def h(name, level) - return "#{name}\n#{HEADER_LEVELS[level] * name.to_s.length}\n\n" + "#{name}\n#{HEADER_LEVELS[level] * name.to_s.length}\n\n" end def initialize(name, options = {}, &block) @@ -136,7 +136,7 @@ class Puppet::Util::Reference # Indent every line in the chunk except those which begin with '..'. def indent(text, tab) - return text.gsub(/(^|\A)/, tab).gsub(/^ +\.\./, "..") + text.gsub(/(^|\A)/, tab).gsub(/^ +\.\./, "..") end def option(name, value) @@ -152,7 +152,7 @@ class Puppet::Util::Reference #str += text.gsub(/\n/, "\n ") str += "\n\n" - return str + str end # Remove all trac links. @@ -176,7 +176,7 @@ class Puppet::Util::Reference text += self.class.footer if withcontents - return text + text end def to_text(withcontents = true) diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index 7c6177f81..ab7e12d29 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -18,7 +18,7 @@ module Puppet::Util::SELinux if Selinux.is_selinux_enabled == 1 return true end - return false + false end # Retrieve and return the full context of the file. If we don't have @@ -29,7 +29,7 @@ module Puppet::Util::SELinux if retval == -1 return nil end - return retval[1] + retval[1] end # Retrieve and return the default context of the file. If we don't have @@ -51,7 +51,7 @@ module Puppet::Util::SELinux if retval == -1 return nil end - return retval[1] + retval[1] end # Take the full SELinux context returned from the tools and parse it @@ -70,7 +70,7 @@ module Puppet::Util::SELinux :seltype => $3, :selrange => $4, } - return ret[component] + ret[component] end # This updates the actual SELinux label on the file. You can update @@ -133,7 +133,7 @@ module Puppet::Util::SELinux set_selinux_context(file, new_context) return new_context end - return nil + nil end # Internal helper function to read and parse /proc/mounts @@ -168,7 +168,7 @@ module Puppet::Util::SELinux next if params[2] == 'rootfs' mntpoint[params[1]] = params[2] end - return mntpoint + mntpoint end def realpath(path) @@ -199,7 +199,7 @@ module Puppet::Util::SELinux return mnts[path] if mnts.has_key?(path) path = parent_directory(path) end - return mnts['/'] + mnts['/'] end # Check filesystem a path resides on for SELinux support against @@ -210,7 +210,7 @@ module Puppet::Util::SELinux fstype = find_fs(file) return false if fstype.nil? filesystems = ['ext2', 'ext3', 'ext4', 'gfs', 'gfs2', 'xfs', 'jfs'] - return filesystems.include?(fstype) + filesystems.include?(fstype) end end diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index 055492c84..7c70dfa8f 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -37,7 +37,7 @@ class Puppet::Util::Settings setting.getopt_args.each { |args| options << args } } - return options + options end # Generate the list of valid arguments, in a format that OptionParser can @@ -48,13 +48,13 @@ class Puppet::Util::Settings options << setting.optparse_args } - return options + options end # Is our parameter a boolean parameter? def boolean?(param) param = param.to_sym - return !!(@config.include?(param) and @config[param].kind_of? BooleanSetting) + !!(@config.include?(param) and @config[param].kind_of? BooleanSetting) end # Remove all set values, potentially skipping cli values. @@ -98,7 +98,7 @@ class Puppet::Util::Settings end end - return newval + newval end # Return a value's description. @@ -247,11 +247,11 @@ class Puppet::Util::Settings def print_configs return print_config_options if value(:configprint) != "" return generate_config if value(:genconfig) - return generate_manifest if value(:genmanifest) + generate_manifest if value(:genmanifest) end def print_configs? - return (value(:configprint) != "" || value(:genconfig) || value(:genmanifest)) && true + (value(:configprint) != "" || value(:genconfig) || value(:genmanifest)) && true end # Return a given object's file metadata. @@ -392,7 +392,7 @@ class Puppet::Util::Settings hash[:settings] = self setting = klass.new(hash) - return setting + setting end # This has to be private, because it doesn't add the settings to @config @@ -463,7 +463,7 @@ class Puppet::Util::Settings user = Puppet::Type.type(:user).new :name => self[:user], :audit => :ensure - return @service_user_available = user.exists? + @service_user_available = user.exists? end def legacy_to_mode(type, param) @@ -481,7 +481,7 @@ class Puppet::Util::Settings Puppet.warning "You have configuration parameter $#{param} specified in [#{type}], which is a deprecated section. I'm assuming you meant [#{new_type}]" return new_type end - return type + type end def set_value(param, value, type, options = {}) @@ -515,7 +515,7 @@ class Puppet::Util::Settings Puppet::Node::Environment.clear if defined?(Puppet::Node) and defined?(Puppet::Node::Environment) end - return value + value end # Set a bunch of defaults in a given section. The sections are actually pretty @@ -675,7 +675,7 @@ if @config.include?(:run_mode) # If we didn't get a value, use the default val = @config[param].default if val.nil? - return val + val end # Find the correct value using our search path. Optionally accept an environment @@ -709,7 +709,7 @@ if @config.include?(:run_mode) # And cache it @cache[environment||"none"][param] = val - return val + val end # Open a file with the appropriate user, group, and mode @@ -786,7 +786,7 @@ if @config.include?(:run_mode) raise ArgumentError, "Default #{default} is not a file" unless obj.is_a? FileSetting - return obj + obj end # Create the transportable objects for users and groups. @@ -845,7 +845,7 @@ if @config.include?(:run_mode) '' end result[:value] = value.sub(/\s*$/, '') - return result + result end # Convert arguments into booleans, integers, or whatever. @@ -916,7 +916,7 @@ if @config.include?(:run_mode) end } - return result + result end # Read the file in. diff --git a/lib/puppet/util/settings/file_setting.rb b/lib/puppet/util/settings/file_setting.rb index bbb388bd6..351a1ae81 100644 --- a/lib/puppet/util/settings/file_setting.rb +++ b/lib/puppet/util/settings/file_setting.rb @@ -57,7 +57,7 @@ class Puppet::Util::Settings::FileSetting < Puppet::Util::Settings::Setting @type = :directory return value.sub(/\/$/, '') end - return value + value end # Return the appropriate type. diff --git a/lib/puppet/util/settings/setting.rb b/lib/puppet/util/settings/setting.rb index 848c7780e..ba7e4b526 100644 --- a/lib/puppet/util/settings/setting.rb +++ b/lib/puppet/util/settings/setting.rb @@ -50,11 +50,11 @@ class Puppet::Util::Settings::Setting end def iscreated? - return defined?(@iscreated) && @iscreated + defined?(@iscreated) && @iscreated end def set? - return !!(defined?(@value) and ! @value.nil?) + !!(defined?(@value) and ! @value.nil?) end # short name for the celement diff --git a/lib/puppet/util/storage.rb b/lib/puppet/util/storage.rb index 8ca1881ed..f821c8fd7 100644 --- a/lib/puppet/util/storage.rb +++ b/lib/puppet/util/storage.rb @@ -9,7 +9,7 @@ class Puppet::Util::Storage include Puppet::Util def self.state - return @@state + @@state end def initialize @@ -28,7 +28,7 @@ class Puppet::Util::Storage name = object.to_s end - return @@state[name] ||= {} + @@state[name] ||= {} end def self.clear diff --git a/lib/puppet/util/subclass_loader.rb b/lib/puppet/util/subclass_loader.rb index 02d4af159..6f861439a 100644 --- a/lib/puppet/util/subclass_loader.rb +++ b/lib/puppet/util/subclass_loader.rb @@ -63,14 +63,14 @@ module Puppet::Util::SubclassLoader super end return nil unless defined?(@subclassname) - return self.send(@subclassname, method) || nil + self.send(@subclassname, method) || nil end # Retrieve or calculate a name. def name(dummy_argument=:work_arround_for_ruby_GC_bug) @name = self.to_s.sub(/.+::/, '').intern unless defined?(@name) - return @name + @name end # Provide a list of all subclasses. diff --git a/lib/puppet/util/suidmanager.rb b/lib/puppet/util/suidmanager.rb index c6b5e3c89..0fea99e8b 100644 --- a/lib/puppet/util/suidmanager.rb +++ b/lib/puppet/util/suidmanager.rb @@ -24,7 +24,7 @@ module Puppet::Util::SUIDManager # But 'macosx_productversion_major' requires it. Facter.loadfacts @osx_maj_ver = Facter.value('macosx_productversion_major') - return @osx_maj_ver + @osx_maj_ver end module_function :osx_maj_ver @@ -76,7 +76,7 @@ module Puppet::Util::SUIDManager if ret == nil raise Puppet::Error, "Invalid #{map[type]}: #{id}" end - return ret + ret end module_function :convert_xid diff --git a/lib/puppet/util/user_attr.rb b/lib/puppet/util/user_attr.rb index db8fb81b9..c26c4911a 100644 --- a/lib/puppet/util/user_attr.rb +++ b/lib/puppet/util/user_attr.rb @@ -16,6 +16,6 @@ class UserAttr break end end - return attributes + attributes end end diff --git a/lib/puppet/util/warnings.rb b/lib/puppet/util/warnings.rb index a63d91359..3156b412c 100644 --- a/lib/puppet/util/warnings.rb +++ b/lib/puppet/util/warnings.rb @@ -13,7 +13,7 @@ module Puppet::Util::Warnings def clear_warnings() @stampwarnings = {} - return nil + nil end protected @@ -24,6 +24,6 @@ module Puppet::Util::Warnings return nil if @stampwarnings[klass].include? message yield @stampwarnings[klass] << message - return nil + nil end end diff --git a/spec/integration/parser/parser_spec.rb b/spec/integration/parser/parser_spec.rb index ee476c02f..ff81758d1 100755 --- a/spec/integration/parser/parser_spec.rb +++ b/spec/integration/parser/parser_spec.rb @@ -17,7 +17,7 @@ describe Puppet::Parser::Parser do def matches?(string) @string = string @result = @parser.parse(string) - return result_instance.instance_of?(@class) + result_instance.instance_of?(@class) end def description @@ -50,7 +50,7 @@ describe Puppet::Parser::Parser do def matches?(string) @string = string @result = @parser.parse(string) - return @block.call(result_instance) + @block.call(result_instance) end def description diff --git a/spec/unit/parser/scope_spec.rb b/spec/unit/parser/scope_spec.rb index c394282ca..ed965af14 100755 --- a/spec/unit/parser/scope_spec.rb +++ b/spec/unit/parser/scope_spec.rb @@ -125,7 +125,7 @@ describe Puppet::Parser::Scope do klass = newclass(name) Puppet::Parser::Resource.new("class", name, :scope => @scope, :source => mock('source')).evaluate - return @scope.class_scope(klass) + @scope.class_scope(klass) end it "should be able to look up explicitly fully qualified variables from main" do diff --git a/spec/unit/provider/mount/parsed_spec.rb b/spec/unit/provider/mount/parsed_spec.rb index 8d1c6ad9e..d0ec4723c 100755 --- a/spec/unit/provider/mount/parsed_spec.rb +++ b/spec/unit/provider/mount/parsed_spec.rb @@ -23,7 +23,7 @@ module ParsedMountTesting name = "linux.fstab" end oldpath = @provider_class.default_target - return fakefile(File::join("data/types/mount", name)) + fakefile(File::join("data/types/mount", name)) end def mkmountargs @@ -43,7 +43,7 @@ module ParsedMountTesting args[field] = "fake#{field}#{@pcount}" unless args.include? field end - return args + args end def mkmount @@ -59,7 +59,7 @@ module ParsedMountTesting hash[:ensure] = :present mount.property_hash = hash - return mount + mount end # Here we just create a fake host type that answers to all of the methods diff --git a/test/language/snippets.rb b/test/language/snippets.rb index c42d67397..fe22e46bf 100755 --- a/test/language/snippets.rb +++ b/test/language/snippets.rb @@ -55,7 +55,7 @@ class TestSnippets < Test::Unit::TestCase parser.file = file ast = parser.parse - return ast + ast end def snippet2ast(text) @@ -63,7 +63,7 @@ class TestSnippets < Test::Unit::TestCase parser.string = text ast = parser.parse - return ast + ast end def client @@ -77,7 +77,7 @@ class TestSnippets < Test::Unit::TestCase scope = Puppet::Parser::Scope.new() ast.evaluate(scope) - return scope + scope end def scope2objs(scope) diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb index e5a1dce80..22e7a3b37 100755 --- a/test/lib/puppettest.rb +++ b/test/lib/puppettest.rb @@ -90,7 +90,7 @@ module PuppetTest # what makes things like '-n' work). opts.each { |o| ARGV << o } - return args + args end # Find the root of the Puppet tree; this is not the test directory, but @@ -237,17 +237,17 @@ module PuppetTest f = File.join(self.tmpdir(), "tempfile_" + @@tmpfilenum.to_s) @@tmpfiles ||= [] @@tmpfiles << f - return f + f end def textmate? - return !!ENV["TM_FILENAME"] + !!ENV["TM_FILENAME"] end def tstdir dir = tempfile() Dir.mkdir(dir) - return dir + dir end def tmpdir diff --git a/test/lib/puppettest/certificates.rb b/test/lib/puppettest/certificates.rb index 198ec96c4..9ab64d762 100644 --- a/test/lib/puppettest/certificates.rb +++ b/test/lib/puppettest/certificates.rb @@ -13,7 +13,7 @@ module PuppetTest::Certificates f.print "as;dklj23rlkjzdflij23wr" } - return keyfile + keyfile end def mkCA @@ -22,7 +22,7 @@ module PuppetTest::Certificates ca = Puppet::SSLCertificates::CA.new() } - return ca + ca end def mkStore(ca) @@ -41,7 +41,7 @@ module PuppetTest::Certificates cert.mkcsr } - return cert + cert end def mksignedcert(ca = nil, hostname = nil) @@ -52,7 +52,7 @@ module PuppetTest::Certificates assert_nothing_raised { cert, cacert = ca.sign(mkcert(hostname).mkcsr) } - return cert + cert end end diff --git a/test/lib/puppettest/exetest.rb b/test/lib/puppettest/exetest.rb index 78f391ddd..105ebc11c 100644 --- a/test/lib/puppettest/exetest.rb +++ b/test/lib/puppettest/exetest.rb @@ -39,7 +39,7 @@ module PuppetTest::ExeTest Dir.chdir(bindir()) { out = %x{#{@ruby} #{cmd}} } - return out + out end def startmasterd(args = "") @@ -75,7 +75,7 @@ module PuppetTest::ExeTest sleep(1) end - return manifest + manifest end def stopmasterd(running = true) diff --git a/test/lib/puppettest/fakes.rb b/test/lib/puppettest/fakes.rb index 2db045ab5..a05d0f5c5 100644 --- a/test/lib/puppettest/fakes.rb +++ b/test/lib/puppettest/fakes.rb @@ -149,7 +149,7 @@ module PuppetTest end end - return ret + ret end def store(hash) diff --git a/test/lib/puppettest/filetesting.rb b/test/lib/puppettest/filetesting.rb index 2ecfce58f..6f07c2ad4 100644 --- a/test/lib/puppettest/filetesting.rb +++ b/test/lib/puppettest/filetesting.rb @@ -26,7 +26,7 @@ module PuppetTest::FileTesting ret.push item } - return ret + ret end def mkranddirsandfiles(dirs = nil,files = nil,depth = 3) @@ -63,7 +63,7 @@ module PuppetTest::FileTesting FileUtils.cd(dir) { list = %x{find . 2>/dev/null}.chomp.split(/\n/) } - return list + list end def assert_trees_equal(fromdir,todir) @@ -145,7 +145,7 @@ module PuppetTest::FileTesting end } - return deleted + deleted end def add_random_files(dir) @@ -168,7 +168,7 @@ module PuppetTest::FileTesting false end } - return added + added end def modify_random_files(dir) @@ -191,7 +191,7 @@ module PuppetTest::FileTesting false end } - return modded + modded end def readonly_random_files(dir) @@ -211,7 +211,7 @@ module PuppetTest::FileTesting false end } - return modded + modded end def conffile diff --git a/test/lib/puppettest/parsertesting.rb b/test/lib/puppettest/parsertesting.rb index a23bd5601..1165773fd 100644 --- a/test/lib/puppettest/parsertesting.rb +++ b/test/lib/puppettest/parsertesting.rb @@ -17,7 +17,7 @@ module PuppetTest::ParserTesting def evaluate(*args) @evaluated = true - return @evaluate + @evaluate end def initialize(val = nil) @@ -46,7 +46,7 @@ module PuppetTest::ParserTesting def mkcompiler(parser = nil) node = mknode - return Compiler.new(node) + Compiler.new(node) end def mknode(name = nil) @@ -330,7 +330,7 @@ module PuppetTest::ParserTesting ) end - return func + func end # This assumes no nodes @@ -356,7 +356,7 @@ module PuppetTest::ParserTesting obj["mode"] = "644" } - return obj + obj end def mk_transbucket(*resources) @@ -369,7 +369,7 @@ module PuppetTest::ParserTesting resources.each { |o| bucket << o } - return bucket + bucket end # Make a tree of resources, yielding if desired @@ -404,7 +404,7 @@ module PuppetTest::ParserTesting bucket = newbucket end - return top + top end # Take a list of AST resources, evaluate them, and return the results @@ -423,6 +423,6 @@ module PuppetTest::ParserTesting trans = scope.evaluate(:ast => top) } - return trans + trans end end diff --git a/test/lib/puppettest/reporttesting.rb b/test/lib/puppettest/reporttesting.rb index 49520d23a..b0cb0f2ec 100644 --- a/test/lib/puppettest/reporttesting.rb +++ b/test/lib/puppettest/reporttesting.rb @@ -10,7 +10,7 @@ module PuppetTest::Reporttesting report << log } - return report + report end end diff --git a/test/lib/puppettest/servertest.rb b/test/lib/puppettest/servertest.rb index 0a7b7f01a..df78159c8 100644 --- a/test/lib/puppettest/servertest.rb +++ b/test/lib/puppettest/servertest.rb @@ -27,7 +27,7 @@ module PuppetTest::ServerTest @@tmpfiles << @createdfile @@tmpfiles << file - return file + file end # create a server, forked into the background @@ -67,7 +67,7 @@ module PuppetTest::ServerTest # give the server a chance to do its thing sleep 1 - return spid + spid end end diff --git a/test/lib/puppettest/support/assertions.rb b/test/lib/puppettest/support/assertions.rb index b918e28f6..8426869eb 100644 --- a/test/lib/puppettest/support/assertions.rb +++ b/test/lib/puppettest/support/assertions.rb @@ -50,7 +50,7 @@ module PuppetTest run_events(:evaluate, transaction, events, msg) - return transaction + transaction end # A simpler method that just applies what we have. diff --git a/test/lib/puppettest/support/resources.rb b/test/lib/puppettest/support/resources.rb index 6b771dda8..0eec20aae 100755 --- a/test/lib/puppettest/support/resources.rb +++ b/test/lib/puppettest/support/resources.rb @@ -19,7 +19,7 @@ module PuppetTest::Support::Resources config.add_edge(comp, resource) config.add_resource resource unless config.resource(resource.ref) end - return comp + comp end def mktree @@ -30,6 +30,6 @@ module PuppetTest::Support::Resources top = treenode(config, "top", "g", "h", middle, one) end - return catalog + catalog end end diff --git a/test/lib/puppettest/support/utils.rb b/test/lib/puppettest/support/utils.rb index 61ab6e754..466798abe 100644 --- a/test/lib/puppettest/support/utils.rb +++ b/test/lib/puppettest/support/utils.rb @@ -35,7 +35,7 @@ module PuppetTest::Support::Utils config = Puppet::Resource::Catalog.new resources.each { |res| config.add_resource res } end - return config + config end # stop any services that might be hanging around @@ -80,7 +80,7 @@ module PuppetTest::Support::Utils assert_equal(events, newevents, "Incorrect #{type} #{msg} events") - return trans + trans end def fakefile(name) @@ -88,7 +88,7 @@ module PuppetTest::Support::Utils ary += name.split("/") file = File.join(ary) raise Puppet::DevError, "No fakedata file #{file}" unless FileTest.exists?(file) - return file + file end # wrap how to retrieve the masked mode @@ -137,7 +137,7 @@ module PuppetTest::Support::Utils resources.each { |resource| conf.add_resource resource } end - return config + config end end diff --git a/test/lib/rake/puppet_testtask.rb b/test/lib/rake/puppet_testtask.rb index a4b8d8b7f..dfdf72332 100644 --- a/test/lib/rake/puppet_testtask.rb +++ b/test/lib/rake/puppet_testtask.rb @@ -12,7 +12,7 @@ module Rake file = find_file('rake/puppet_test_loader') or fail "unable to find rake test loader" end - return file + file end end end diff --git a/test/network/authstore.rb b/test/network/authstore.rb index 72c4ee584..9837a4686 100755 --- a/test/network/authstore.rb +++ b/test/network/authstore.rb @@ -15,7 +15,7 @@ class TestAuthStore < Test::Unit::TestCase store = Puppet::Network::AuthStore.new } - return store + store end def setup diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb index 32951bcce..667adb853 100755 --- a/test/network/handler/fileserver.rb +++ b/test/network/handler/fileserver.rb @@ -19,7 +19,7 @@ class TestFileServer < Test::Unit::TestCase mount = Puppet::Network::Handler.fileserver::Mount.new(name, base) } - return mount + mount end # make a simple file source def mktestdir @@ -36,7 +36,7 @@ class TestFileServer < Test::Unit::TestCase } } - return [testdir, %r{#{pattern}}, tmpfile] + [testdir, %r{#{pattern}}, tmpfile] end # make a bunch of random test files diff --git a/test/network/xmlrpc/processor.rb b/test/network/xmlrpc/processor.rb index 0b0646728..69f4c2fdc 100755 --- a/test/network/xmlrpc/processor.rb +++ b/test/network/xmlrpc/processor.rb @@ -51,7 +51,7 @@ class TestXMLRPCProcessor < Test::Unit::TestCase fakeparser = Class.new do def parseMethodCall(data) - return data + data end end diff --git a/test/other/provider.rb b/test/other/provider.rb index e746a330a..341c364f4 100755 --- a/test/other/provider.rb +++ b/test/other/provider.rb @@ -30,7 +30,7 @@ class TestImpl < Test::Unit::TestCase assert_nothing_raised("Could not create provider") do provider = type.provide(name) {} end - return provider + provider end def test_provider_default diff --git a/test/other/report.rb b/test/other/report.rb index b5cbec0c3..d15fb5505 100755 --- a/test/other/report.rb +++ b/test/other/report.rb @@ -38,7 +38,7 @@ class TestReports < Test::Unit::TestCase report = Puppet::Transaction::Report.new trans.add_metrics_to_report(report) - return report + report end # Make sure we can use reports as log destinations. diff --git a/test/other/transactions.rb b/test/other/transactions.rb index fa4fa4f61..dd5348e33 100755 --- a/test/other/transactions.rb +++ b/test/other/transactions.rb @@ -51,7 +51,7 @@ class TestTransactions < Test::Unit::TestCase Puppet::Type.rmtype(:generator) end - return type + type end # Create a new type that generates instances with shorter names. @@ -70,7 +70,7 @@ class TestTransactions < Test::Unit::TestCase type.class_eval(&block) if block - return type + type end def test_prefetch diff --git a/test/ral/manager/attributes.rb b/test/ral/manager/attributes.rb index 95a077620..24edf37dc 100755 --- a/test/ral/manager/attributes.rb +++ b/test/ral/manager/attributes.rb @@ -276,7 +276,7 @@ class TestTypeAttributes < Test::Unit::TestCase $yep = :absent type.provide(:only) do def self.supports_parameter?(param) - return param.name != :nope + param.name != :nope end def yep diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb index 9182dab09..5190bc7c7 100755 --- a/test/ral/manager/type.rb +++ b/test/ral/manager/type.rb @@ -177,10 +177,10 @@ class TestType < Test::Unit::TestCase # Create a type with a fake provider providerclass = Class.new do def self.supports_parameter?(prop) - return true + true end def method_missing(method, *args) - return method + method end end self.class.const_set("ProviderClass", providerclass) diff --git a/test/ral/providers/group.rb b/test/ral/providers/group.rb index 6a0d20268..48120f332 100755 --- a/test/ral/providers/group.rb +++ b/test/ral/providers/group.rb @@ -41,7 +41,7 @@ class TestGroupProvider < Test::Unit::TestCase } assert(group, "Could not create provider group") - return group + group end case Facter["operatingsystem"].value @@ -63,7 +63,7 @@ class TestGroupProvider < Test::Unit::TestCase end } - return nil + nil end def remove(group) @@ -85,7 +85,7 @@ class TestGroupProvider < Test::Unit::TestCase return obj.gid } - return nil + nil end def remove(group) diff --git a/test/ral/providers/host/parsed.rb b/test/ral/providers/host/parsed.rb index 2060276d7..d14e33f7b 100755 --- a/test/ral/providers/host/parsed.rb +++ b/test/ral/providers/host/parsed.rb @@ -62,7 +62,7 @@ class TestParsedHostProvider < Test::Unit::TestCase host.send(name.to_s + "=", val) end - return host + host end # Make sure we convert both directlys correctly using a simple host. diff --git a/test/ral/providers/mailalias/aliases.rb b/test/ral/providers/mailalias/aliases.rb index 76bbc60c6..8c2626ee9 100755 --- a/test/ral/providers/mailalias/aliases.rb +++ b/test/ral/providers/mailalias/aliases.rb @@ -43,7 +43,7 @@ class TestMailaliasAliasesProvider < Test::Unit::TestCase key.send(p.to_s + "=", v) end - return key + key end def test_data_parsing_and_generating diff --git a/test/ral/providers/package.rb b/test/ral/providers/package.rb index 03b81477d..b91f5d92d 100755 --- a/test/ral/providers/package.rb +++ b/test/ral/providers/package.rb @@ -33,7 +33,7 @@ class TestPackageProvider < Test::Unit::TestCase end } - return array + array end def self.suitable_test_packages diff --git a/test/ral/providers/provider.rb b/test/ral/providers/provider.rb index 081020638..3ffbfd985 100755 --- a/test/ral/providers/provider.rb +++ b/test/ral/providers/provider.rb @@ -13,7 +13,7 @@ class TestProvider < Test::Unit::TestCase raise "Could not find 'echo' binary; cannot complete test" unless echo - return echo + echo end def newprovider @@ -23,7 +23,7 @@ class TestProvider < Test::Unit::TestCase end provider.initvars - return provider + provider end def setup diff --git a/test/ral/providers/sshkey/parsed.rb b/test/ral/providers/sshkey/parsed.rb index e58f59173..2b4d3a603 100755 --- a/test/ral/providers/sshkey/parsed.rb +++ b/test/ral/providers/sshkey/parsed.rb @@ -44,7 +44,7 @@ class TestParsedSSHKey < Test::Unit::TestCase key.send(p.to_s + "=", v) end - return key + key end def test_keysparse diff --git a/test/ral/providers/user.rb b/test/ral/providers/user.rb index 793b6493e..033632894 100755 --- a/test/ral/providers/user.rb +++ b/test/ral/providers/user.rb @@ -57,7 +57,7 @@ class TestUserProvider < Test::Unit::TestCase end } - return nil + nil end def remove(user) @@ -83,7 +83,7 @@ class TestUserProvider < Test::Unit::TestCase return obj.send(user.posixmethod(param)) } - return nil + nil end def remove(user) @@ -146,7 +146,7 @@ class TestUserProvider < Test::Unit::TestCase } assert(user, "Could not create provider user") - return user + user end def test_list diff --git a/test/ral/type/cron.rb b/test/ral/type/cron.rb index 37cba1b3c..384a6ad32 100755 --- a/test/ral/type/cron.rb +++ b/test/ral/type/cron.rb @@ -76,7 +76,7 @@ class TestCron < Test::Unit::TestCase cron = @crontype.new(args) } - return cron + cron end # Run the cron through its paces -- install it then remove it. diff --git a/test/ral/type/file.rb b/test/ral/type/file.rb index f7c4c2b2a..726dcb72f 100755 --- a/test/ral/type/file.rb +++ b/test/ral/type/file.rb @@ -16,7 +16,7 @@ class TestFile < Test::Unit::TestCase assert_nothing_raised { file = Puppet::Type.type(:file).new(hash) } - return file + file end def mktestfile diff --git a/test/ral/type/filesources.rb b/test/ral/type/filesources.rb index 7541a7cbe..d3eb537c1 100755 --- a/test/ral/type/filesources.rb +++ b/test/ral/type/filesources.rb @@ -93,7 +93,7 @@ class TestFileSources < Test::Unit::TestCase source = "puppet://localhost/#{networked}#{fromdir}" if networked recursive_source_test(source, todir) - return [fromdir,todir, File.join(todir, "one"), File.join(todir, "two")] + [fromdir,todir, File.join(todir, "one"), File.join(todir, "two")] end def test_complex_sources_twice @@ -226,7 +226,7 @@ class TestFileSources < Test::Unit::TestCase } @@tmpfiles << file - return file + file end def test_unmountedNetworkSources diff --git a/test/ral/type/host.rb b/test/ral/type/host.rb index 3259e3ae9..2715f6438 100755 --- a/test/ral/type/host.rb +++ b/test/ral/type/host.rb @@ -54,7 +54,7 @@ class TestHost < Test::Unit::TestCase ) } - return host + host end def test_list diff --git a/test/ral/type/sshkey.rb b/test/ral/type/sshkey.rb index 01d72156a..4e5525bd3 100755 --- a/test/ral/type/sshkey.rb +++ b/test/ral/type/sshkey.rb @@ -59,7 +59,7 @@ class TestSSHKey < Test::Unit::TestCase @catalog.add_resource(key) - return key + key end def test_instances diff --git a/test/ral/type/user.rb b/test/ral/type/user.rb index 3187101e1..fd5dcd199 100755 --- a/test/ral/type/user.rb +++ b/test/ral/type/user.rb @@ -78,7 +78,7 @@ class TestUser < Test::Unit::TestCase assert(user, "Did not create user") - return user + user end def test_autorequire diff --git a/test/ral/type/yumrepo.rb b/test/ral/type/yumrepo.rb index fcfd73f99..8efa83518 100755 --- a/test/ral/type/yumrepo.rb +++ b/test/ral/type/yumrepo.rb @@ -89,7 +89,7 @@ class TestYumRepo < Test::Unit::TestCase def all_sections(inifile) sections = [] inifile.each_section { |section| sections << section.name } - return sections.sort + sections.sort end def copy_datafiles diff --git a/test/ral/type/zone.rb b/test/ral/type/zone.rb index c136fbfb1..f6ef98a6e 100755 --- a/test/ral/type/zone.rb +++ b/test/ral/type/zone.rb @@ -33,7 +33,7 @@ class TestZone < PuppetTest::TestCase @@zones << name - return zone + zone end def test_instances diff --git a/test/util/inifile.rb b/test/util/inifile.rb index c33a27ecd..2d5841ca0 100755 --- a/test/util/inifile.rb +++ b/test/util/inifile.rb @@ -127,12 +127,12 @@ class TestFileType < Test::Unit::TestCase def get_section(name) result = @file[name] assert_not_nil(result) - return result + result end def mkfile(content) file = tempfile() File.open(file, "w") { |f| f.print(content) } - return file + file end end diff --git a/test/util/log.rb b/test/util/log.rb index b33e1d2fe..cbaa71a55 100755 --- a/test/util/log.rb +++ b/test/util/log.rb @@ -28,7 +28,7 @@ class TestLog < Test::Unit::TestCase Puppet::Util::Log.eachlevel { |level| levels << level } } # Don't test the top levels; too annoying - return levels.reject { |level| level == :emerg or level == :crit } + levels.reject { |level| level == :emerg or level == :crit } end def mkmsgs(levels) diff --git a/test/util/metrics.rb b/test/util/metrics.rb index 70b85cebd..2575330b5 100755 --- a/test/util/metrics.rb +++ b/test/util/metrics.rb @@ -37,7 +37,7 @@ class TestMetric < PuppetTest::TestCase eventdata[event] = rand(eventmax) } - return {:typedata => typedata, :eventdata => eventdata} + {:typedata => typedata, :eventdata => eventdata} end def rundata(report, time) diff --git a/test/util/settings.rb b/test/util/settings.rb index fa47a1227..2e2d0b019 100755 --- a/test/util/settings.rb +++ b/test/util/settings.rb @@ -86,7 +86,7 @@ class TestSettings < Test::Unit::TestCase def mkconfig c = Puppet::Util::Settings.new c.setdefaults :main, :noop => [false, "foo"] - return c + c end def test_addbools diff --git a/test/util/storage.rb b/test/util/storage.rb index 2259a59d2..ae28bf992 100755 --- a/test/util/storage.rb +++ b/test/util/storage.rb @@ -20,7 +20,7 @@ class TestStorage < Test::Unit::TestCase :check => %w{checksum type} ) - return f + f end def test_storeandretrieve |