<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet.git/lib/puppet/network/handler, branch ticket/master/7841</title>
<subtitle>Puppet repo</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/'/>
<entry>
<title>(#8704) Give better errors for invalid fileserver.conf</title>
<updated>2011-07-29T19:52:02+00:00</updated>
<author>
<name>Matt Robinson</name>
<email>matt@puppetlabs.com</email>
</author>
<published>2011-07-29T19:29:51+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=94f0b93b6065d1818f0f3b99d12d651655247c30'/>
<id>94f0b93b6065d1818f0f3b99d12d651655247c30</id>
<content type='text'>
If you tried to just put an allow or deny line in the fileserver.conf
without a mount point, you got a really confusing error message:

    lib/puppet/network/handler/fileserver.rb:285:in `readconfig': undefined method `info' for nil:NilClass (NoMethodError)

Now instead we give an error saying no mount point was specified.

Reviewed-by: Josh Cooper &lt;josh@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If you tried to just put an allow or deny line in the fileserver.conf
without a mount point, you got a really confusing error message:

    lib/puppet/network/handler/fileserver.rb:285:in `readconfig': undefined method `info' for nil:NilClass (NoMethodError)

Now instead we give an error saying no mount point was specified.

Reviewed-by: Josh Cooper &lt;josh@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Maint: Modified uses of indirector.save to call the indirection directly.</title>
<updated>2010-11-30T22:39:39+00:00</updated>
<author>
<name>Paul Berry</name>
<email>paul@puppetlabs.com</email>
</author>
<published>2010-11-30T20:06:52+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=0747b58bfef9c6bb5f1f9ac1eb6a7b3955dac2af'/>
<id>0747b58bfef9c6bb5f1f9ac1eb6a7b3955dac2af</id>
<content type='text'>
This change replaces calls to &lt;model object&gt;.save with calls to &lt;model
class&gt;.indirection.save(&lt;model object&gt;).  This makes the use of the
indirector explicit rather than implicit so that it will be easier to
search for all indirector call sites using grep.  This is an
intermediate refactor on the way towards allowing indirector calls to
be explicitly routed to multiple termini.

This patch affects production code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change replaces calls to &lt;model object&gt;.save with calls to &lt;model
class&gt;.indirection.save(&lt;model object&gt;).  This makes the use of the
indirector explicit rather than implicit so that it will be easier to
search for all indirector call sites using grep.  This is an
intermediate refactor on the way towards allowing indirector calls to
be explicitly routed to multiple termini.

This patch affects production code.
</pre>
</div>
</content>
</entry>
<entry>
<title>Maint: Refactor code to use &lt;class&gt;.indirection.&lt;method&gt;</title>
<updated>2010-11-29T20:08:26+00:00</updated>
<author>
<name>Paul Berry</name>
<email>paul@puppetlabs.com</email>
</author>
<published>2010-11-29T19:56:40+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=71ecad9904c8c48c023e90e5fbea5b26b180c9cf'/>
<id>71ecad9904c8c48c023e90e5fbea5b26b180c9cf</id>
<content type='text'>
Replaced uses of the find, search, destroy, and expire methods on
model classes with direct calls to the indirection objects.  Also
removed the old methods that delegated to the indirection object.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replaced uses of the find, search, destroy, and expire methods on
model classes with direct calls to the indirection objects.  Also
removed the old methods that delegated to the indirection object.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge commit '2.6.3' into next</title>
<updated>2010-11-17T23:19:15+00:00</updated>
<author>
<name>Paul Berry</name>
<email>paul@puppetlabs.com</email>
</author>
<published>2010-11-17T23:19:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=e6ec6468c4a9eec58dc155858665a70eee4dfb8c'/>
<id>e6ec6468c4a9eec58dc155858665a70eee4dfb8c</id>
<content type='text'>
Resolved conflicts manually:
	spec/integration/indirector/bucket_file/rest_spec.rb
	spec/integration/indirector/certificate_revocation_list/rest_spec.rb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Resolved conflicts manually:
	spec/integration/indirector/bucket_file/rest_spec.rb
	spec/integration/indirector/certificate_revocation_list/rest_spec.rb
</pre>
</div>
</content>
</entry>
<entry>
<title>Maint: Added missing requires to fileserver.rb.</title>
<updated>2010-11-09T20:05:49+00:00</updated>
<author>
<name>Paul Berry</name>
<email>paul@puppetlabs.com</email>
</author>
<published>2010-11-09T20:05:49+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=2ec1b552e24d3b42391a6471e477422f67ea00bd'/>
<id>2ec1b552e24d3b42391a6471e477422f67ea00bd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>(#5233) Randomize tmp dir paths</title>
<updated>2010-11-08T20:04:26+00:00</updated>
<author>
<name>Matt Robinson</name>
<email>matt@puppetlabs.com</email>
</author>
<published>2010-11-08T20:04:26+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=21db472640c8e606565c9693d4737f40a1bf8cce'/>
<id>21db472640c8e606565c9693d4737f40a1bf8cce</id>
<content type='text'>
Standardize how we create tmpdirs by using the puppet function instead
of Dir.tmpdir.

Paired-with: Paul Berry &lt;paul@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Standardize how we create tmpdirs by using the puppet function instead
of Dir.tmpdir.

Paired-with: Paul Berry &lt;paul@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Code smell: Two space indentation</title>
<updated>2010-07-10T01:12:17+00:00</updated>
<author>
<name>Markus Roberts</name>
<email>Markus@reality.com</email>
</author>
<published>2010-07-10T01:12:17+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=3180b9d9b2c844dade1d361326600f7001ec66dd'/>
<id>3180b9d9b2c844dade1d361326600f7001ec66dd</id>
<content type='text'>
Replaced 106806 occurances of ^( +)(.*$) with

The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people
who learned ruby in the 1900s) uses two-space indentation.

3 Examples:

    The code:
        end

        # Tell getopt which arguments are valid
        def test_get_getopt_args
            element = Setting.new :name =&gt; "foo", :desc =&gt; "anything", :settings =&gt; Puppet::Util::Settings.new
            assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")

    becomes:
        end

        # Tell getopt which arguments are valid
        def test_get_getopt_args
          element = Setting.new :name =&gt; "foo", :desc =&gt; "anything", :settings =&gt; Puppet::Util::Settings.new
          assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")

    The code:
            assert_equal(str, val)

            assert_instance_of(Float, result)

        end

        # Now test it with a passed object
    becomes:
          assert_equal(str, val)

          assert_instance_of(Float, result)

        end

        # Now test it with a passed object
    The code:
        end

        assert_nothing_raised do
            klass[:Yay] = "boo"
            klass["Cool"] = :yayness
        end

    becomes:
        end

        assert_nothing_raised do
          klass[:Yay] = "boo"
          klass["Cool"] = :yayness
        end
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replaced 106806 occurances of ^( +)(.*$) with

The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people
who learned ruby in the 1900s) uses two-space indentation.

3 Examples:

    The code:
        end

        # Tell getopt which arguments are valid
        def test_get_getopt_args
            element = Setting.new :name =&gt; "foo", :desc =&gt; "anything", :settings =&gt; Puppet::Util::Settings.new
            assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")

    becomes:
        end

        # Tell getopt which arguments are valid
        def test_get_getopt_args
          element = Setting.new :name =&gt; "foo", :desc =&gt; "anything", :settings =&gt; Puppet::Util::Settings.new
          assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")

    The code:
            assert_equal(str, val)

            assert_instance_of(Float, result)

        end

        # Now test it with a passed object
    becomes:
          assert_equal(str, val)

          assert_instance_of(Float, result)

        end

        # Now test it with a passed object
    The code:
        end

        assert_nothing_raised do
            klass[:Yay] = "boo"
            klass["Cool"] = :yayness
        end

    becomes:
        end

        assert_nothing_raised do
          klass[:Yay] = "boo"
          klass["Cool"] = :yayness
        end
</pre>
</div>
</content>
</entry>
<entry>
<title>Code smell: Avoid needless decorations</title>
<updated>2010-07-10T01:07:15+00:00</updated>
<author>
<name>Markus Roberts</name>
<email>Markus@reality.com</email>
</author>
<published>2010-07-10T01:07:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=543225970225de5697734bfaf0a6eee996802c04'/>
<id>543225970225de5697734bfaf0a6eee996802c04</id>
<content type='text'>
* Replaced 704 occurances of (.*)\b([a-z_]+)\(\) with \1\2

  3 Examples:

      The code:
          ctx = OpenSSL::SSL::SSLContext.new()
      becomes:
          ctx = OpenSSL::SSL::SSLContext.new
      The code:
          skip()
      becomes:
          skip
      The code:
          path = tempfile()
      becomes:
          path = tempfile

* Replaced 31 occurances of ^( *)end *#.* with \1end

  3 Examples:

      The code:

      becomes:

      The code:
          end # Dir.foreach
      becomes:
          end
      The code:
          end # def
      becomes:
          end
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Replaced 704 occurances of (.*)\b([a-z_]+)\(\) with \1\2

  3 Examples:

      The code:
          ctx = OpenSSL::SSL::SSLContext.new()
      becomes:
          ctx = OpenSSL::SSL::SSLContext.new
      The code:
          skip()
      becomes:
          skip
      The code:
          path = tempfile()
      becomes:
          path = tempfile

* Replaced 31 occurances of ^( *)end *#.* with \1end

  3 Examples:

      The code:

      becomes:

      The code:
          end # Dir.foreach
      becomes:
          end
      The code:
          end # def
      becomes:
          end
</pre>
</div>
</content>
</entry>
<entry>
<title>Code smell: Use ||= for conditional initialization</title>
<updated>2010-07-10T01:06:48+00:00</updated>
<author>
<name>Markus Roberts</name>
<email>Markus@reality.com</email>
</author>
<published>2010-07-10T01:06:48+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=42a539061293f8e745a9dc5b97b4415b6a275e04'/>
<id>42a539061293f8e745a9dc5b97b4415b6a275e04</id>
<content type='text'>
Replaced 55 occurances of

    ([$@]?\w+) += +(.*) +(if +\1.nil\?|if +! *\1|unless +\1|unless +defined\?\(\1\))$

with

    \1 ||= \2

3 Examples:

    The code:
        @sync
    becomes:
        @sync
    The code:

    becomes:

    The code:
        if @yydebug
    becomes:
        if @yydebug
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replaced 55 occurances of

    ([$@]?\w+) += +(.*) +(if +\1.nil\?|if +! *\1|unless +\1|unless +defined\?\(\1\))$

with

    \1 ||= \2

3 Examples:

    The code:
        @sync
    becomes:
        @sync
    The code:

    becomes:

    The code:
        if @yydebug
    becomes:
        if @yydebug
</pre>
</div>
</content>
</entry>
<entry>
<title>Code smell: Avoid explicit returns</title>
<updated>2010-07-10T01:06:33+00:00</updated>
<author>
<name>Markus Roberts</name>
<email>Markus@reality.com</email>
</author>
<published>2010-07-10T01:06:33+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=8d1fbe4586c91682cdda0cb271649e918fd9778b'/>
<id>8d1fbe4586c91682cdda0cb271649e918fd9778b</id>
<content type='text'>
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] &lt;&lt; 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] &lt;&lt; spec
                    break
                end
            end
            filters
        end
    The code:
        def retrieve
            return_value = super
            return_value = return_value[0] if return_value &amp;&amp; return_value.is_a?(Array)

            return return_value
        end
    becomes:
        def retrieve
            return_value = super
            return_value = return_value[0] if return_value &amp;&amp; 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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] &lt;&lt; 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] &lt;&lt; spec
                    break
                end
            end
            filters
        end
    The code:
        def retrieve
            return_value = super
            return_value = return_value[0] if return_value &amp;&amp; return_value.is_a?(Array)

            return return_value
        end
    becomes:
        def retrieve
            return_value = super
            return_value = return_value[0] if return_value &amp;&amp; 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
</pre>
</div>
</content>
</entry>
</feed>
