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

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:34:09 UTC 2010


The following commit has been merged in the upstream branch:
commit 2874729efa22c56dde61654e7429bdbb4e41f9ef
Author: Rein Henrichs <rein at puppetlabs.com>
Date:   Mon Jun 7 15:35:52 2010 -0700

    [#3921] Remove unnecessary require 'puppet/resource'
    
    * Remove require statements
    * explicity define namespace modules/classes for
      Puppet::Resource::Status to avoid require dependency cycle.

diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 5ed438d..3f9ac4d 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -749,7 +749,6 @@ module Puppet
             :hook => proc do |value|
                 require 'puppet/node'
                 require 'puppet/node/facts'
-                require 'puppet/resource/catalog'
                 if value
                     raise "StoreConfigs not supported without ActiveRecord 2.1 or higher" unless Puppet.features.rails?
                     Puppet::Resource::Catalog.cache_class = :active_record unless Puppet.settings[:async_storeconfigs]
diff --git a/lib/puppet/parser/ast/resource_reference.rb b/lib/puppet/parser/ast/resource_reference.rb
index 8e09a8e..d2f9b2c 100644
--- a/lib/puppet/parser/ast/resource_reference.rb
+++ b/lib/puppet/parser/ast/resource_reference.rb
@@ -1,6 +1,5 @@
 require 'puppet/parser/ast'
 require 'puppet/parser/ast/branch'
-require 'puppet/resource'
 
 class Puppet::Parser::AST::ResourceReference < Puppet::Parser::AST::Branch
     attr_accessor :title, :type
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index 78d90d4..f221979 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -5,7 +5,6 @@ require 'puppet/resource'
 # parameters
 class Puppet::Parser::Resource < Puppet::Resource
     require 'puppet/parser/resource/param'
-    require 'puppet/resource'
     require 'puppet/util/tagging'
     require 'puppet/file_collection/lookup'
     require 'puppet/parser/yaml_trimmer'
diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb
index a7a4b5b..519f319 100644
--- a/lib/puppet/resource/catalog.rb
+++ b/lib/puppet/resource/catalog.rb
@@ -1,4 +1,3 @@
-require 'puppet/resource'
 require 'puppet/node'
 require 'puppet/indirector'
 require 'puppet/simple_graph'
diff --git a/lib/puppet/resource/status.rb b/lib/puppet/resource/status.rb
index 87c6161..a52b927 100644
--- a/lib/puppet/resource/status.rb
+++ b/lib/puppet/resource/status.rb
@@ -1,54 +1,58 @@
-class Puppet::Resource::Status
-    include Puppet::Util::Tagging
-    include Puppet::Util::Logging
-
-    ATTRIBUTES = [:resource, :node, :version, :file, :line, :current_values, :skipped_reason, :status, :evaluation_time, :change_count]
-    attr_accessor *ATTRIBUTES
-
-    STATES = [:skipped, :failed, :failed_to_restart, :restarted, :changed, :out_of_sync, :scheduled]
-    attr_accessor *STATES
-
-    attr_reader :source_description, :default_log_level, :time, :resource
-
-    # Provide a boolean method for each of the states.
-    STATES.each do |attr|
-        define_method("#{attr}?") do
-            !! send(attr)
-        end
-    end
-
-    def <<(event)
-        add_event(event)
-        self
-    end
-
-    def add_event(event)
-        @events << event
-        if event.status == 'failure'
-            self.failed = true
+module Puppet
+    class Resource
+        class Status
+            include Puppet::Util::Tagging
+            include Puppet::Util::Logging
+
+            ATTRIBUTES = [:resource, :node, :version, :file, :line, :current_values, :skipped_reason, :status, :evaluation_time, :change_count]
+            attr_accessor *ATTRIBUTES
+
+            STATES = [:skipped, :failed, :failed_to_restart, :restarted, :changed, :out_of_sync, :scheduled]
+            attr_accessor *STATES
+
+            attr_reader :source_description, :default_log_level, :time, :resource
+
+            # Provide a boolean method for each of the states.
+            STATES.each do |attr|
+                define_method("#{attr}?") do
+                    !! send(attr)
+                end
+            end
+
+            def <<(event)
+                add_event(event)
+                self
+            end
+
+            def add_event(event)
+                @events << event
+                if event.status == 'failure'
+                    self.failed = true
+                end
+            end
+
+            def events
+                @events
+            end
+
+            def initialize(resource)
+                @source_description = resource.path
+                @resource = resource.to_s
+
+                [:file, :line, :version].each do |attr|
+                    send(attr.to_s + "=", resource.send(attr))
+                end
+
+                tag(*resource.tags)
+                @time = Time.now
+                @events = []
+            end
+
+            private
+
+            def log_source
+                source_description
+            end
         end
     end
-
-    def events
-        @events
-    end
-
-    def initialize(resource)
-        @source_description = resource.path
-        @resource = resource.to_s
-
-        [:file, :line, :version].each do |attr|
-            send(attr.to_s + "=", resource.send(attr))
-        end
-
-        tag(*resource.tags)
-        @time = Time.now
-        @events = []
-    end
-
-    private
-
-    def log_source
-        source_description
-    end
 end
diff --git a/lib/puppet/transportable.rb b/lib/puppet/transportable.rb
index c488170..e6852da 100644
--- a/lib/puppet/transportable.rb
+++ b/lib/puppet/transportable.rb
@@ -1,5 +1,4 @@
 require 'puppet'
-require 'puppet/resource'
 require 'yaml'
 
 module Puppet
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index ce79683..340512a 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -9,7 +9,6 @@ require 'puppet/metatype/manager'
 require 'puppet/util/errors'
 require 'puppet/util/log_paths'
 require 'puppet/util/logging'
-require 'puppet/resource'
 require 'puppet/util/cacher'
 require 'puppet/file_collection/lookup'
 require 'puppet/util/tagging'

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list