[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Max Martin max at puppetlabs.com
Tue May 10 08:14:14 UTC 2011


The following commit has been merged in the experimental branch:
commit 3ab44c7ce01ab86a995deb66228f5be95239c92a
Merge: 7817ccb3438ad2742a98694373e42b65df86eda7 bee1ef73e5c83541edcf1249f062ba832618da48
Author: Max Martin <max at puppetlabs.com>
Date:   Wed Apr 13 17:20:24 2011 -0700

    Merge branch '2.6.x' into next
    
    * 2.6.x:
      Updated CHANGELOG for 2.6.8rc1
      (#2331) Remove darwinports pkg provider, replace with rewritten macports provider
      Fixed #7082 - Added system support for groups
      (#7018) Give more context on the service type's assumptions. Wording tweaks.
      (#7018) explain internals better in service provider documentation
      maint: Fix sqlite3 require to really be optional
      maint: Fix sporadic sqlite error
      (#6818) Stop from getting Rails 3 named_scope deprecation warning
      (#6856) Copy dangling symlinks with 'links => manage' File resource.
    
    Conflicts (Resolved manually):
    	lib/puppet/type/group.rb
    	spec/unit/indirector/facts/inventory_active_record_spec.rb

diff --combined lib/puppet.rb
index 401cecc,a9ed289..6423657
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@@ -24,7 -24,7 +24,7 @@@ require 'puppet/util/run_mode
  # it's also a place to find top-level commands like 'debug'
  
  module Puppet
-   PUPPETVERSION = '2.6.7'
+   PUPPETVERSION = '2.6.8'
  
    def Puppet.version
      PUPPETVERSION
@@@ -141,12 -141,17 +141,12 @@@
      end
    end
  
 -  # Create a new type.  Just proxy to the Type class.
 +  # Create a new type.  Just proxy to the Type class.  The mirroring query
 +  # code was deprecated in 2008, but this is still in heavy use.  I suppose
 +  # this can count as a soft deprecation for the next dev. --daniel 2011-04-12
    def self.newtype(name, options = {}, &block)
      Puppet::Type.newtype(name, options, &block)
    end
 -
 -  # Retrieve a type by name.  Just proxy to the Type class.
 -  def self.type(name)
 -    # LAK:DEP Deprecation notice added 12/17/2008
 -    Puppet.warning "Puppet.type is deprecated; use Puppet::Type.type"
 -    Puppet::Type.type(name)
 -  end
  end
  
  require 'puppet/type'
diff --combined lib/puppet/type/file/source.rb
index d3b3a48,6ebec51..76c646b
--- a/lib/puppet/type/file/source.rb
+++ b/lib/puppet/type/file/source.rb
@@@ -98,7 -98,7 +98,7 @@@ module Puppe
      cached_attr(:content) do
        raise Puppet::DevError, "No source for content was stored with the metadata" unless metadata.source
  
 -      unless tmp = Puppet::FileServing::Content.find(metadata.source)
 +      unless tmp = Puppet::FileServing::Content.indirection.find(metadata.source)
          fail "Could not find any content at %s" % metadata.source
        end
        tmp.content
@@@ -114,6 -114,7 +114,7 @@@
          param_name = (metadata_method == :checksum) ? :content : metadata_method
          next if metadata_method == :owner and !Puppet.features.root?
          next if metadata_method == :checksum and metadata.ftype == "directory"
+         next if metadata_method == :checksum and metadata.ftype == "link" and metadata.links == :manage
  
          if resource[param_name].nil? or resource[param_name] == :absent
            resource[param_name] = metadata.send(metadata_method)
@@@ -144,7 -145,7 +145,7 @@@
        result = nil
        value.each do |source|
          begin
 -          if data = Puppet::FileServing::Metadata.find(source)
 +          if data = Puppet::FileServing::Metadata.indirection.find(source)
              result = data
              result.source = source
              break
diff --combined lib/puppet/type/group.rb
index 2573633,066bd49..b534ef2
--- a/lib/puppet/type/group.rb
+++ b/lib/puppet/type/group.rb
@@@ -1,7 -1,5 +1,6 @@@
- 
  require 'etc'
  require 'facter'
 +require 'puppet/property/keyvalue'
  
  module Puppet
    newtype(:group) do
@@@ -16,9 -14,9 +15,12 @@@
      feature :manages_members,
        "For directories where membership is an attribute of groups not users."
  
 +    feature :manages_aix_lam,
 +      "The provider can manage AIX Loadable Authentication Module (LAM) system."
 +
+     feature :system_groups,
+       "The provider allows you to create system groups with lower GIDs."
+ 
      ensurable do
        desc "Create or remove the group."
  
@@@ -100,37 -98,12 +102,44 @@@
        defaultto false
      end
  
 +    newparam(:ia_load_module, :required_features => :manages_aix_lam) do
 +      desc "The name of the I&A module to use to manage this user"
 +
 +      defaultto "compat"
 +    end
 +
 +    newproperty(:attributes, :parent => Puppet::Property::KeyValue, :required_features => :manages_aix_lam) do
 +      desc "Specify group AIX attributes in an array of keyvalue pairs"
 +
 +      def membership
 +        :attribute_membership
 +      end
-       
++
 +      def delimiter
 +        " "
 +      end
 +
 +      validate do |value|
 +        raise ArgumentError, "Attributes value pairs must be seperated by an =" unless value.include?("=")
 +      end
 +    end
 +
 +    newparam(:attribute_membership) do
 +      desc "Whether specified attribute value pairs should be treated as the only attributes
 +        of the user or whether they should merely
 +        be treated as the minimum list."
 +
 +      newvalues(:inclusive, :minimum)
 +
 +      defaultto :minimum
 +    end
 +
+     newparam(:system, :boolean => true) do
+       desc "Whether the group is a system group with lower GID."
+ 
+       newvalues(:true, :false)
+ 
+       defaultto false
+     end
    end
  end
diff --combined lib/puppet/type/service.rb
index 3ef0449,3658e28..5a2c69b
--- a/lib/puppet/type/service.rb
+++ b/lib/puppet/type/service.rb
@@@ -8,19 -8,24 +8,24 @@@ module Puppe
  
    newtype(:service) do
      @doc = "Manage running services.  Service support unfortunately varies
-       widely by platform -- some platforms have very little if any
+       widely by platform --- some platforms have very little if any
        concept of a running service, and some have a very codified and
        powerful concept.  Puppet's service support will generally be able
-       to make up for any inherent shortcomings (e.g., if there is no
+       to do the right thing regardless (e.g., if there is no
        'status' command, then Puppet will look in the process table for a
        command matching the service name), but the more information you
-       can provide the better behaviour you will get.  Or, you can just
-       use a platform that has very good service support.
+       can provide, the better behaviour you will get. In particular, any
+       virtual services that don't have a predictable entry in the process table
+       (for example, `network` on Red Hat/CentOS systems) will manifest odd
+       behavior on restarts if you don't specify `hasstatus` or a `status`
+       command.
  
        Note that if a `service` receives an event from another resource,
        the service will get restarted. The actual command to restart the
-       service depends on the platform. You can provide a special command
-       for restarting with the `restart` attribute."
+       service depends on the platform. You can provide an explicit command
+       for restarting with the `restart` attribute, or use the init script's
+       restart command with the `hasrestart` attribute; if you do neither,
+       the service's stop and start commands will be used."
  
      feature :refreshable, "The provider can restart the service.",
        :methods => [:restart]
@@@ -93,15 -98,16 +98,18 @@@
          that a large number of init scripts on different platforms do
          not support any kind of status command; thus, you must specify
          manually whether the service you are running has such a
-         command (or you can specify a specific command using the
-         `status` parameter).
- 
-         If you do not specify anything, then the service name will be
-         looked for in the process table."
+         command. Alternately, you can provide a specific command using the
+         `status` attribute.
+ 
+         If you specify neither of these, then Puppet will look for the
+         service name in the process table. Be aware that 'virtual' init
+         scripts such as networking will respond poorly to refresh events
+         (via notify and subscribe relationships) if you don't override
+         this default behavior."
  
        newvalues(:true, :false)
 +
 +      defaultto :true
      end
      newparam(:name) do
        desc "The name of the service to run.  This name is used to find
diff --combined spec/unit/provider/group/groupadd_spec.rb
index 8709fe7,65cc887..585eb02
--- a/spec/unit/provider/group/groupadd_spec.rb
+++ b/spec/unit/provider/group/groupadd_spec.rb
@@@ -1,5 -1,6 +1,5 @@@
 -#!/usr/bin/env ruby
 -
 -require File.dirname(__FILE__) + '/../../../spec_helper'
 +#!/usr/bin/env rspec
 +require 'spec_helper'
  
  provider_class = Puppet::Type.type(:group).provider(:groupadd)
  
@@@ -9,10 -10,10 +9,10 @@@ describe provider_class d
      @provider = provider_class.new(@resource)
    end
  
    it "should add -o when allowdupe is enabled and the group is being created" do
      @resource.stubs(:should).returns "fakeval"
      @resource.stubs(:[]).returns "fakeval"
+     @resource.stubs(:system?).returns true
      @resource.expects(:allowdupe?).returns true
      @provider.expects(:execute).with { |args| args.include?("-o") }
  
@@@ -27,4 -28,14 +27,14 @@@
  
      @provider.gid = 150
    end
+ 
+   it "should add -r when system is enabled and the group is being created" do
+     @resource.stubs(:should).returns "fakeval"
+     @resource.stubs(:[]).returns "fakeval"
+     @resource.expects(:system?).returns true
+     @resource.stubs(:allowdupe?).returns true
+     @provider.expects(:execute).with { |args| args.include?("-r") }
+ 
+     @provider.create
+   end
  end
diff --combined spec/unit/type/file/source_spec.rb
index e8683b7,6e04fa2..5665d32
--- a/spec/unit/type/file/source_spec.rb
+++ b/spec/unit/type/file/source_spec.rb
@@@ -1,5 -1,6 +1,5 @@@
 -#!/usr/bin/env ruby
 -
 -Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
 +#!/usr/bin/env rspec
 +require 'spec_helper'
  
  source = Puppet::Type.type(:file).attrclass(:source)
  describe Puppet::Type.type(:file).attrclass(:source) do
@@@ -53,22 -54,22 +53,22 @@@
  
      it "should collect its metadata using the Metadata class if it is not already set" do
        @source = source.new(:resource => @resource, :value => "/foo/bar")
 -      Puppet::FileServing::Metadata.expects(:find).with("/foo/bar").returns @metadata
 +      Puppet::FileServing::Metadata.indirection.expects(:find).with("/foo/bar").returns @metadata
        @source.metadata
      end
  
      it "should use the metadata from the first found source" do
        metadata = stub 'metadata', :source= => nil
        @source = source.new(:resource => @resource, :value => ["/foo/bar", "/fee/booz"])
 -      Puppet::FileServing::Metadata.expects(:find).with("/foo/bar").returns nil
 -      Puppet::FileServing::Metadata.expects(:find).with("/fee/booz").returns metadata
 +      Puppet::FileServing::Metadata.indirection.expects(:find).with("/foo/bar").returns nil
 +      Puppet::FileServing::Metadata.indirection.expects(:find).with("/fee/booz").returns metadata
        @source.metadata.should equal(metadata)
      end
  
      it "should store the found source as the metadata's source" do
        metadata = mock 'metadata'
        @source = source.new(:resource => @resource, :value => "/foo/bar")
 -      Puppet::FileServing::Metadata.expects(:find).with("/foo/bar").returns metadata
 +      Puppet::FileServing::Metadata.indirection.expects(:find).with("/foo/bar").returns metadata
  
        metadata.expects(:source=).with("/foo/bar")
        @source.metadata
@@@ -76,7 -77,7 +76,7 @@@
  
      it "should fail intelligently if an exception is encountered while querying for metadata" do
        @source = source.new(:resource => @resource, :value => "/foo/bar")
 -      Puppet::FileServing::Metadata.expects(:find).with("/foo/bar").raises RuntimeError
 +      Puppet::FileServing::Metadata.indirection.expects(:find).with("/foo/bar").raises RuntimeError
  
        @source.expects(:fail).raises ArgumentError
        lambda { @source.metadata }.should raise_error(ArgumentError)
@@@ -84,7 -85,7 +84,7 @@@
  
      it "should fail if no specified sources can be found" do
        @source = source.new(:resource => @resource, :value => "/foo/bar")
 -      Puppet::FileServing::Metadata.expects(:find).with("/foo/bar").returns nil
 +      Puppet::FileServing::Metadata.indirection.expects(:find).with("/foo/bar").returns nil
  
        @source.expects(:fail).raises RuntimeError
  
@@@ -95,7 -96,7 +95,7 @@@
        expirer = stub 'expired', :dependent_data_expired? => true
  
        metadata = stub 'metadata', :source= => nil
 -      Puppet::FileServing::Metadata.expects(:find).with("/fee/booz").returns metadata
 +      Puppet::FileServing::Metadata.indirection.expects(:find).with("/fee/booz").returns metadata
  
        @source = source.new(:resource => @resource, :value => ["/fee/booz"])
        @source.metadata = "foo"
@@@ -186,6 -187,7 +186,7 @@@
      describe "and the source is a link" do
        it "should set the target to the link destination" do
          @metadata.stubs(:ftype).returns "link"
+         @metadata.stubs(:links).returns "manage"
          @resource.stubs(:[])
          @resource.stubs(:[]=)
  
diff --combined spec/unit/type/group_spec.rb
index b32204a,e373dac..42fd3fb
--- a/spec/unit/type/group_spec.rb
+++ b/spec/unit/type/group_spec.rb
@@@ -1,5 -1,6 +1,5 @@@
 -#!/usr/bin/env ruby
 -
 -require File.dirname(__FILE__) + '/../../spec_helper'
 +#!/usr/bin/env rspec
 +require 'spec_helper'
  
  describe Puppet::Type.type(:group) do
    before do
@@@ -15,6 -16,10 +15,10 @@@
      @class.defaultprovider.ancestors.should be_include(Puppet::Provider)
    end
  
+   it "should have a system_groups feature" do
+     @class.provider_feature(:system_groups).should_not be_nil
+   end
+ 
    describe "when validating attributes" do
      [:name, :allowdupe].each do |param|
        it "should have a #{param} parameter" do
@@@ -37,11 -42,14 +41,14 @@@
      end
    end
  
-   # #1407 - we need to declare the allowdupe param as boolean.
    it "should have a boolean method for determining if duplicates are allowed" do
      @class.new(:name => "foo").methods.should be_include("allowdupe?")
    end
  
+   it "should have a boolean method for determining if system groups are allowed" do
+     @class.new(:name => "foo").methods.should be_include("system?")
+   end
+ 
    it "should call 'create' to create the group" do
      group = @class.new(:name => "foo", :ensure => :present)
      group.provider.expects(:create)

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list