[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

Markus Roberts Markus at reality.com
Wed Jul 14 10:37:24 UTC 2010


The following commit has been merged in the upstream branch:
commit 8f15707251cdb58d53e82c4bbd332a38c2d31b4c
Author: Markus Roberts <Markus at reality.com>
Date:   Fri Jul 9 18:06:58 2010 -0700

    Code smell: Don't restate results directly after assignment
    
    Replaced 33 occurances of
    
            ([$@]?\w+)( +[|&+-]{0,2}= .+)
            \1
        end
    
    with
    
    3 Examples:
    
        The code:
                @sync ||= Sync.new
                @sync
            end
        becomes:
                @sync ||= Sync.new
            end
        The code:
                str += "\n"
                str
            end
        becomes:
                str += "\n"
            end
        The code:
                @indirection = Puppet::Indirector::Indirection.new(self, indirection,  options)
                @indirection
            end
        becomes:
                @indirection = Puppet::Indirector::Indirection.new(self, indirection,  options)
            end

diff --git a/lib/puppet/agent.rb b/lib/puppet/agent.rb
index 58bf5cd..8d131fb 100644
--- a/lib/puppet/agent.rb
+++ b/lib/puppet/agent.rb
@@ -82,7 +82,6 @@ class Puppet::Agent
 
     def sync
         @sync ||= Sync.new
-        @sync
     end
 
     private
diff --git a/lib/puppet/external/nagios/base.rb b/lib/puppet/external/nagios/base.rb
index b526a80..6e3b003 100755
--- a/lib/puppet/external/nagios/base.rb
+++ b/lib/puppet/external/nagios/base.rb
@@ -293,7 +293,6 @@ class Nagios::Base
             str += ldapname + ": #{value}\n"
         }
         str += "\n"
-        str
     end
 
     def to_s
diff --git a/lib/puppet/indirector.rb b/lib/puppet/indirector.rb
index 125445d..1caad6c 100644
--- a/lib/puppet/indirector.rb
+++ b/lib/puppet/indirector.rb
@@ -28,7 +28,6 @@ module Puppet::Indirector
         # instantiate the actual Terminus for that type and this name (:ldap, w/ args :node)
         # & hook the instantiated Terminus into this class (Node: @indirection = terminus)
         @indirection = Puppet::Indirector::Indirection.new(self, indirection,  options)
-        @indirection
     end
 
     module ClassMethods
diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb
index 2827628..3a59f3e 100644
--- a/lib/puppet/indirector/indirection.rb
+++ b/lib/puppet/indirector/indirection.rb
@@ -65,7 +65,6 @@ class Puppet::Indirector::Indirection
     # Default to the runinterval for the ttl.
     def ttl
         @ttl ||= Puppet[:runinterval].to_i
-        @ttl
     end
 
     # Calculate the expiration date for a returned instance.
diff --git a/lib/puppet/indirector/node/ldap.rb b/lib/puppet/indirector/node/ldap.rb
index c6f17d0..93da5a8 100644
--- a/lib/puppet/indirector/node/ldap.rb
+++ b/lib/puppet/indirector/node/ldap.rb
@@ -43,7 +43,6 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
         end
 
         info = name2hash('default',name_env,'parent')
-        info
     end
 
     # Look for our node in ldap.
diff --git a/lib/puppet/indirector/request.rb b/lib/puppet/indirector/request.rb
index faf9a13..ffc2d31 100644
--- a/lib/puppet/indirector/request.rb
+++ b/lib/puppet/indirector/request.rb
@@ -22,7 +22,6 @@ class Puppet::Indirector::Request
 
     def environment
         @environment ||= Puppet::Node::Environment.new()
-        @environment
     end
 
     def environment=(env)
diff --git a/lib/puppet/network/authconfig.rb b/lib/puppet/network/authconfig.rb
index b058012..932d6da 100644
--- a/lib/puppet/network/authconfig.rb
+++ b/lib/puppet/network/authconfig.rb
@@ -7,7 +7,6 @@ module Puppet
 
         def self.main
             @main ||= self.new()
-            @main
         end
 
         # Just proxy the setting methods to our rights stuff
diff --git a/lib/puppet/network/client.rb b/lib/puppet/network/client.rb
index 1d720cc..f9c50cd 100644
--- a/lib/puppet/network/client.rb
+++ b/lib/puppet/network/client.rb
@@ -49,19 +49,16 @@ class Puppet::Network::Client
     # client/server stuff.  E.g., you could call Client::CA.new(:CA => ca).
     def self.drivername
         @drivername ||= self.name
-        @drivername
     end
 
     # Figure out the handler for our client.
     def self.handler
         @handler ||= Puppet::Network::Handler.handler(self.name)
-        @handler
     end
 
     # The class that handles xmlrpc interaction for us.
     def self.xmlrpc_client
         @xmlrpc_client ||= Puppet::Network::XMLRPCClient.handler_class(self.handler)
-        @xmlrpc_client
     end
 
     # Create our client.
diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb
index 5bcd5fb..3afd1dc 100644
--- a/lib/puppet/network/xmlrpc/client.rb
+++ b/lib/puppet/network/xmlrpc/client.rb
@@ -151,7 +151,6 @@ module Puppet::Network
 
         def http
             @http ||= Puppet::Network::HttpPool.http_instance(host, port, true)
-            @http
         end
 
         attr_reader :host, :port
diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb
index ba4c269..d86c1fd 100644
--- a/lib/puppet/property.rb
+++ b/lib/puppet/property.rb
@@ -22,7 +22,6 @@ class Puppet::Property < Puppet::Parameter
         # the first value.
         def array_matching
             @array_matching ||= :first
-            @array_matching
         end
 
         # Set whether properties should match all values or just the first one.
diff --git a/lib/puppet/provider.rb b/lib/puppet/provider.rb
index 937f114..67d0089 100644
--- a/lib/puppet/provider.rb
+++ b/lib/puppet/provider.rb
@@ -175,7 +175,6 @@ class Puppet::Provider
     # Retrieve the data source.  Defaults to the provider name.
     def self.source
         @source ||= self.name
-        @source
     end
 
     # Does this provider support the specified parameter?
diff --git a/lib/puppet/provider/confine/variable.rb b/lib/puppet/provider/confine/variable.rb
index 9dde40a..84f7e40 100644
--- a/lib/puppet/provider/confine/variable.rb
+++ b/lib/puppet/provider/confine/variable.rb
@@ -19,7 +19,6 @@ class Puppet::Provider::Confine::Variable < Puppet::Provider::Confine
     # Retrieve the value from facter
     def facter_value
         @facter_value ||= ::Facter.value(name).to_s.downcase
-        @facter_value
     end
 
     def initialize(values)
diff --git a/lib/puppet/provider/confiner.rb b/lib/puppet/provider/confiner.rb
index 012eaa8..d776b68 100644
--- a/lib/puppet/provider/confiner.rb
+++ b/lib/puppet/provider/confiner.rb
@@ -7,7 +7,6 @@ module Puppet::Provider::Confiner
 
     def confine_collection
         @confine_collection ||= Puppet::Provider::ConfineCollection.new(self.to_s)
-        @confine_collection
     end
 
     # Check whether this implementation is suitable for our platform.
diff --git a/lib/puppet/provider/group/ldap.rb b/lib/puppet/provider/group/ldap.rb
index a4baa6e..d0eca0d 100644
--- a/lib/puppet/provider/group/ldap.rb
+++ b/lib/puppet/provider/group/ldap.rb
@@ -43,6 +43,5 @@ Puppet::Type.type(:group).provide :ldap, :parent => Puppet::Provider::Ldap do
         # Only use the first result.
         group = result[0]
         gid = group[:gid][0]
-        gid
     end
 end
diff --git a/lib/puppet/provider/mcx/mcxcontent.rb b/lib/puppet/provider/mcx/mcxcontent.rb
index 4711413..ba9ca31 100644
--- a/lib/puppet/provider/mcx/mcxcontent.rb
+++ b/lib/puppet/provider/mcx/mcxcontent.rb
@@ -178,7 +178,6 @@ Puppet::Type.type(:mcx).provide :mcxcontent, :parent => Puppet::Provider do
             return false
         end
         has_mcx = ! mcx.empty?
-        has_mcx
     end
 
     def content
diff --git a/lib/puppet/provider/parsedfile.rb b/lib/puppet/provider/parsedfile.rb
index 53585b1..6104c0c 100755
--- a/lib/puppet/provider/parsedfile.rb
+++ b/lib/puppet/provider/parsedfile.rb
@@ -35,7 +35,6 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
 
     def self.filetype
         @filetype ||= Puppet::Util::FileType.filetype(:flat)
-        @filetype
     end
 
     def self.filetype=(type)
diff --git a/lib/puppet/provider/service/freebsd.rb b/lib/puppet/provider/service/freebsd.rb
index 3ff81fd..f491d70 100644
--- a/lib/puppet/provider/service/freebsd.rb
+++ b/lib/puppet/provider/service/freebsd.rb
@@ -18,7 +18,6 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do
     def rcvar
         rcvar = execute([self.initscript, :rcvar], :failonfail => true, :squelch => false)
         rcvar = rcvar.split("\n")
-        rcvar
     end
 
     # Extract service name
diff --git a/lib/puppet/reports/rrdgraph.rb b/lib/puppet/reports/rrdgraph.rb
index c93f13e..b152faa 100644
--- a/lib/puppet/reports/rrdgraph.rb
+++ b/lib/puppet/reports/rrdgraph.rb
@@ -23,7 +23,6 @@ Puppet::Reports.register_report(:rrdgraph) do
 
     def hostdir
         @hostdir ||= File.join(Puppet[:rrddir], self.host)
-        @hostdir
     end
 
     def htmlfile(type, graphs, field)
diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb
index 027b0fb..c8ffef5 100644
--- a/lib/puppet/simple_graph.rb
+++ b/lib/puppet/simple_graph.rb
@@ -135,7 +135,6 @@ 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? }
-        l
     end
 
     # Collect all of the edges that the passed events match.  Returns
diff --git a/lib/puppet/ssl/certificate_authority.rb b/lib/puppet/ssl/certificate_authority.rb
index 00dbf60..be74c2f 100644
--- a/lib/puppet/ssl/certificate_authority.rb
+++ b/lib/puppet/ssl/certificate_authority.rb
@@ -149,7 +149,6 @@ class Puppet::SSL::CertificateAuthority
     # Retrieve (or create, if necessary) our inventory manager.
     def inventory
         @inventory ||= Puppet::SSL::Inventory.new
-        @inventory
     end
 
     # Generate a new password for the CA.
diff --git a/lib/puppet/util/cacher.rb b/lib/puppet/util/cacher.rb
index df8c28a..c87661a 100644
--- a/lib/puppet/util/cacher.rb
+++ b/lib/puppet/util/cacher.rb
@@ -89,7 +89,6 @@ module Puppet::Util::Cacher
 
         def cache_timestamp
             @cache_timestamp ||= Time.now
-            @cache_timestamp
         end
 
         def cached_value(name)
@@ -123,7 +122,6 @@ module Puppet::Util::Cacher
 
         def value_cache
             @value_cache ||= {}
-            @value_cache
         end
     end
 end
diff --git a/lib/puppet/util/filetype.rb b/lib/puppet/util/filetype.rb
index 98aaf8c..554ac05 100755
--- a/lib/puppet/util/filetype.rb
+++ b/lib/puppet/util/filetype.rb
@@ -73,7 +73,6 @@ class Puppet::Util::FileType
     # Pick or create a filebucket to use.
     def bucket
         @bucket ||= Puppet::Type.type(:filebucket).mkdefaultbucket.bucket
-        @bucket
     end
 
     def initialize(path)
diff --git a/lib/puppet/util/inline_docs.rb b/lib/puppet/util/inline_docs.rb
index 95a8c2a..1e54506 100644
--- a/lib/puppet/util/inline_docs.rb
+++ b/lib/puppet/util/inline_docs.rb
@@ -16,7 +16,6 @@ module Puppet::Util::InlineDocs
 
         def doc
             @doc ||= ""
-            @doc
         end
 
         # don't fetch lexer comment by default
diff --git a/lib/puppet/util/rdoc/generators/puppet_generator.rb b/lib/puppet/util/rdoc/generators/puppet_generator.rb
index a956241..24579d6 100644
--- a/lib/puppet/util/rdoc/generators/puppet_generator.rb
+++ b/lib/puppet/util/rdoc/generators/puppet_generator.rb
@@ -874,7 +874,6 @@ module Generators
         def find_symbol(symbol, method=nil)
             res = @context.parent.find_symbol(symbol, method)
             res &&= res.viewer
-            res
         end
 
     end
diff --git a/lib/puppet/util/reference.rb b/lib/puppet/util/reference.rb
index 24da1e5..fb4b84f 100644
--- a/lib/puppet/util/reference.rb
+++ b/lib/puppet/util/reference.rb
@@ -152,7 +152,6 @@ class Puppet::Util::Reference
         #str += text.gsub(/\n/, "\n    ")
 
         str += "\n\n"
-        str
     end
 
     # Remove all trac links.
diff --git a/lib/puppet/util/suidmanager.rb b/lib/puppet/util/suidmanager.rb
index 0fea99e..9815646 100644
--- a/lib/puppet/util/suidmanager.rb
+++ b/lib/puppet/util/suidmanager.rb
@@ -24,7 +24,6 @@ module Puppet::Util::SUIDManager
         # But 'macosx_productversion_major' requires it.
         Facter.loadfacts
         @osx_maj_ver = Facter.value('macosx_productversion_major')
-        @osx_maj_ver
     end
     module_function :osx_maj_ver
 
diff --git a/test/network/authorization.rb b/test/network/authorization.rb
index 680d567..cecc1fd 100755
--- a/test/network/authorization.rb
+++ b/test/network/authorization.rb
@@ -48,7 +48,6 @@ class TestAuthConfig < Test::Unit::TestCase
         class << @obj
             def authconfig
                 @authconfig ||= FakeAuth.new
-                @authconfig
             end
         end
         @request = Puppet::Network::ClientRequest.new("host", "ip", false)
diff --git a/test/ral/manager/instances.rb b/test/ral/manager/instances.rb
index b9ac584..7daa105 100755
--- a/test/ral/manager/instances.rb
+++ b/test/ral/manager/instances.rb
@@ -40,7 +40,6 @@ class TestTypeInstances < Test::Unit::TestCase
             end
             def self.instances
                 @instances ||= names.collect { |name| instance(name) }
-                @instances
             end
 
             @names = [:one, :five, :six]
diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb
index 41d12c8..0da9cc2 100755
--- a/test/ral/providers/cron/crontab.rb
+++ b/test/ral/providers/cron/crontab.rb
@@ -24,7 +24,6 @@ class TestCronParsedProvider < Test::Unit::TestCase
     # parsed, so all they
     def sample_crons
         @sample_crons ||= YAML.load(File.read(File.join(@crondir, "crontab_collections.yaml")))
-        @sample_crons
     end
 
     # These are simple lines that can appear in the files; there is a one to one
@@ -32,7 +31,6 @@ class TestCronParsedProvider < Test::Unit::TestCase
     # we use these records to build up our complex, multi-line cron jobs below.
     def sample_records
         @sample_records ||= YAML.load(File.read(File.join(@crondir, "crontab_sample_records.yaml")))
-        @sample_records
     end
 
     def setup

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list