diff options
author | Luke Kanies <luke@madstop.com> | 2008-12-09 15:33:28 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-12-18 11:10:21 -0600 |
commit | d48fff6658535ca1781443aba9ab21893c13e55c (patch) | |
tree | 4fcfd8b502a0f23f057a6e0695f466195978f366 | |
parent | c927ce05bbd96fa9aacc8e52f8eb797403a1e433 (diff) | |
download | puppet-d48fff6658535ca1781443aba9ab21893c13e55c.tar.gz puppet-d48fff6658535ca1781443aba9ab21893c13e55c.tar.xz puppet-d48fff6658535ca1781443aba9ab21893c13e55c.zip |
Renaming Puppet::Node::Catalog to Puppet::Resource::Catalog
Signed-off-by: Luke Kanies <luke@madstop.com>
35 files changed, 124 insertions, 124 deletions
diff --git a/bin/puppet b/bin/puppet index f3d8c252f..c01d7392c 100755 --- a/bin/puppet +++ b/bin/puppet @@ -218,7 +218,7 @@ end begin # Compile our catalog starttime = Time.now - catalog = Puppet::Node::Catalog.find(node.name, :use_node => node) + catalog = Puppet::Resource::Catalog.find(node.name, :use_node => node) # Translate it to a RAL catalog catalog = catalog.to_ral @@ -231,7 +231,7 @@ else params.each do |param, value| obj[param] = value end - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource obj begin catalog.apply diff --git a/ext/module_puppet b/ext/module_puppet index 8609e4411..4ee273451 100755 --- a/ext/module_puppet +++ b/ext/module_puppet @@ -180,7 +180,7 @@ node.classes = classes begin # Compile our configuration - catalog = Puppet::Node::Catalog.find(node.name, :use_node => node) + catalog = Puppet::Resource::Catalog.find(node.name, :use_node => node) rescue => detail if Puppet[:trace] puts detail.backtrace diff --git a/ext/puppet-test b/ext/puppet-test index 41759d489..84ea483db 100755 --- a/ext/puppet-test +++ b/ext/puppet-test @@ -220,7 +220,7 @@ Suite.new :local_catalog, "Local catalog handling" do end newtest :compile, "Compiled catalog" do - Puppet::Node::Catalog.find(@node) + Puppet::Resource::Catalog.find(@node) end end diff --git a/lib/puppet/indirector/catalog/compiler.rb b/lib/puppet/indirector/catalog/compiler.rb index a6a812817..df1808d73 100644 --- a/lib/puppet/indirector/catalog/compiler.rb +++ b/lib/puppet/indirector/catalog/compiler.rb @@ -1,10 +1,10 @@ require 'puppet/node' -require 'puppet/node/catalog' +require 'puppet/resource/catalog' require 'puppet/indirector/code' require 'puppet/parser/interpreter' require 'yaml' -class Puppet::Node::Catalog::Compiler < Puppet::Indirector::Code +class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code desc "Puppet's catalog compilation interface, and its back-end is Puppet's compiler" diff --git a/lib/puppet/indirector/catalog/yaml.rb b/lib/puppet/indirector/catalog/yaml.rb index 6a8d1765c..d6fc9b81d 100644 --- a/lib/puppet/indirector/catalog/yaml.rb +++ b/lib/puppet/indirector/catalog/yaml.rb @@ -1,7 +1,7 @@ -require 'puppet/node/catalog' +require 'puppet/resource/catalog' require 'puppet/indirector/yaml' -class Puppet::Node::Catalog::Yaml < Puppet::Indirector::Yaml +class Puppet::Resource::Catalog::Yaml < Puppet::Indirector::Yaml desc "Store catalogs as flat files, serialized using YAML." private diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index d24fd7df7..f86c9bb01 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -319,7 +319,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client if args[:ignore] hash[:ignore] = args[:ignore].split(/\s+/) end - downconfig = Puppet::Node::Catalog.new("downloading") + downconfig = Puppet::Resource::Catalog.new("downloading") downconfig.add_resource Puppet::Type.type(:file).create(hash) Puppet.info "Retrieving #{args[:name]}s" diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index 71b633a09..7bde0af73 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -62,7 +62,7 @@ class Puppet::Network::Handler # Pass the facts to the fact handler Puppet::Node::Facts.new(client, facts).save unless local? - catalog = Puppet::Node::Catalog.find(client) + catalog = Puppet::Resource::Catalog.find(client) case format when "yaml": diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index d67b3d275..9f5548d8b 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -2,7 +2,7 @@ # Copyright (c) 2007. All rights reserved. require 'puppet/node' -require 'puppet/node/catalog' +require 'puppet/resource/catalog' require 'puppet/util/errors' # Maintain a graph of scopes, along with a bunch of data @@ -412,7 +412,7 @@ class Puppet::Parser::Compiler @scope_graph = Puppet::SimpleGraph.new # For maintaining the relationship between scopes and their resources. - @catalog = Puppet::Node::Catalog.new(@node.name) + @catalog = Puppet::Resource::Catalog.new(@node.name) @catalog.version = @parser.version end diff --git a/lib/puppet/node/catalog.rb b/lib/puppet/resource/catalog.rb index bc522cc1e..5b1022799 100644 --- a/lib/puppet/node/catalog.rb +++ b/lib/puppet/resource/catalog.rb @@ -10,7 +10,7 @@ require 'puppet/util/tagging' # meant to be passed from server to client, and it contains all # of the information in the catalog, including the resources # and the relationships between them. -class Puppet::Node::Catalog < Puppet::SimpleGraph +class Puppet::Resource::Catalog < Puppet::SimpleGraph class DuplicateResourceError < Puppet::Error; end extend Puppet::Indirector diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb index 83017222f..30f86a9d7 100644 --- a/lib/puppet/transaction.rb +++ b/lib/puppet/transaction.rb @@ -400,7 +400,7 @@ class Transaction # this should only be called by a Puppet::Type::Component resource now # and it should only receive an array def initialize(resources) - if resources.is_a?(Puppet::Node::Catalog) + if resources.is_a?(Puppet::Resource::Catalog) @catalog = resources elsif resources.is_a?(Puppet::SimpleGraph) raise "Transactions should get catalogs now, not SimpleGraph" diff --git a/lib/puppet/transportable.rb b/lib/puppet/transportable.rb index b809d5b94..9e85b1fe7 100644 --- a/lib/puppet/transportable.rb +++ b/lib/puppet/transportable.rb @@ -181,7 +181,7 @@ module Puppet # Create a resource graph from our structure. def to_catalog(clear_on_failure = true) - catalog = Puppet::Node::Catalog.new(Facter.value("hostname")) + catalog = Puppet::Resource::Catalog.new(Facter.value("hostname")) # This should really use the 'delve' method, but this # whole class is going away relatively soon, hopefully, diff --git a/spec/integration/network/formats.rb b/spec/integration/network/formats.rb index 0cfbadd38..2ec4cb9e8 100755 --- a/spec/integration/network/formats.rb +++ b/spec/integration/network/formats.rb @@ -14,6 +14,6 @@ describe Puppet::Network::FormatHandler.format(:s) do end it "should not support catalogs" do - @format.should_not be_supported(Puppet::Node::Catalog) + @format.should_not be_supported(Puppet::Resource::Catalog) end end diff --git a/spec/integration/node/catalog.rb b/spec/integration/resource/catalog.rb index 438f92834..db25dab67 100755 --- a/spec/integration/node/catalog.rb +++ b/spec/integration/resource/catalog.rb @@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe Puppet::Node::Catalog do +describe Puppet::Resource::Catalog do describe "when using the indirector" do after { Puppet::Util::Cacher.expire } before do @@ -16,21 +16,21 @@ describe Puppet::Node::Catalog do it "should be able to delegate to the :yaml terminus" do - Puppet::Node::Catalog.indirection.stubs(:terminus_class).returns :yaml + Puppet::Resource::Catalog.indirection.stubs(:terminus_class).returns :yaml # Load now, before we stub the exists? method. - terminus = Puppet::Node::Catalog.indirection.terminus(:yaml) + terminus = Puppet::Resource::Catalog.indirection.terminus(:yaml) terminus.expects(:path).with("me").returns "/my/yaml/file" FileTest.expects(:exist?).with("/my/yaml/file").returns false - Puppet::Node::Catalog.find("me").should be_nil + Puppet::Resource::Catalog.find("me").should be_nil end it "should be able to delegate to the :compiler terminus" do - Puppet::Node::Catalog.indirection.stubs(:terminus_class).returns :compiler + Puppet::Resource::Catalog.indirection.stubs(:terminus_class).returns :compiler # Load now, before we stub the exists? method. - compiler = Puppet::Node::Catalog.indirection.terminus(:compiler) + compiler = Puppet::Resource::Catalog.indirection.terminus(:compiler) node = mock 'node' node.stub_everything @@ -38,17 +38,17 @@ describe Puppet::Node::Catalog do Puppet::Node.expects(:find).returns(node) compiler.expects(:compile).with(node).returns nil - Puppet::Node::Catalog.find("me").should be_nil + Puppet::Resource::Catalog.find("me").should be_nil end it "should pass provided node information directly to the terminus" do terminus = mock 'terminus' - Puppet::Node::Catalog.indirection.stubs(:terminus).returns terminus + Puppet::Resource::Catalog.indirection.stubs(:terminus).returns terminus node = mock 'node' terminus.expects(:find).with { |request| request.options[:use_node] == node } - Puppet::Node::Catalog.find("me", :use_node => node) + Puppet::Resource::Catalog.find("me", :use_node => node) end end end diff --git a/spec/integration/type/file.rb b/spec/integration/type/file.rb index 9d1b77788..5f15aa55c 100755 --- a/spec/integration/type/file.rb +++ b/spec/integration/type/file.rb @@ -37,7 +37,7 @@ describe Puppet::Type.type(:file) do @file = Puppet::Type::File.create(:name => @path, :mode => 0644, :recurse => true) - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @file lambda { @file.eval_generate }.should_not raise_error @@ -50,7 +50,7 @@ describe Puppet::Type.type(:file) do @file = Puppet::Type::File.create(:name => @path, :mode => 0644, :recurse => true) - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @file @catalog.apply @@ -73,7 +73,7 @@ describe Puppet::Type.type(:file) do @file = Puppet::Type::File.create(:name => dest, :target => source, :recurse => true, :ensure => :link) - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @file @catalog.apply @@ -100,7 +100,7 @@ describe Puppet::Type.type(:file) do @file = Puppet::Type::File.create(:name => dest, :source => source, :recurse => true) - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @file @catalog.apply @@ -135,7 +135,7 @@ describe Puppet::Type.type(:file) do @file = Puppet::Type::File.create(:name => @dest, :source => @source, :recurse => true) - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @file end @@ -168,7 +168,7 @@ describe Puppet::Type.type(:file) do file = Puppet::Type::File.create(:name => dest, :source => source) - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource file catalog.apply @@ -185,7 +185,7 @@ describe Puppet::Type.type(:file) do file = Puppet::Type::File.create(:name => dest, :source => source) - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource file catalog.apply @@ -201,7 +201,7 @@ describe Puppet::Type.type(:file) do file = Puppet::Type::File.create(:name => dest, :source => source) - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource file catalog.apply @@ -223,7 +223,7 @@ describe Puppet::Type.type(:file) do file = Puppet::Type::File.create(:name => dest, :source => source, :recurse => true) - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource file catalog.apply @@ -239,7 +239,7 @@ describe Puppet::Type.type(:file) do :content => "this is some content, yo" ) - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource file catalog.apply @@ -255,7 +255,7 @@ describe Puppet::Type.type(:file) do :content => "this is some content, yo" ) - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource file catalog.apply @@ -274,7 +274,7 @@ describe Puppet::Type.type(:file) do :source => source ) - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource file catalog.apply @@ -310,7 +310,7 @@ describe Puppet::Type.type(:file) do :purge => true, :recurse => true) - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @lfobj, @destobj end diff --git a/spec/integration/type/tidy.rb b/spec/integration/type/tidy.rb index 2c83e7a8a..3ad7de9ec 100755 --- a/spec/integration/type/tidy.rb +++ b/spec/integration/type/tidy.rb @@ -19,7 +19,7 @@ describe Puppet::Type.type(:tidy) do tidy = Puppet::Type.type(:tidy).create :path => dir, :recurse => true - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new catalog.add_resource(tidy) catalog.apply diff --git a/spec/unit/indirector/catalog/compiler.rb b/spec/unit/indirector/catalog/compiler.rb index 8cd3c72f4..29b76d8e5 100755 --- a/spec/unit/indirector/catalog/compiler.rb +++ b/spec/unit/indirector/catalog/compiler.rb @@ -7,7 +7,7 @@ require File.dirname(__FILE__) + '/../../../spec_helper' require 'puppet/indirector/catalog/compiler' -describe Puppet::Node::Catalog::Compiler do +describe Puppet::Resource::Catalog::Compiler do before do Puppet.expects(:version).returns(1) Facter.expects(:value).with('fqdn').returns("my.server.com") @@ -15,11 +15,11 @@ describe Puppet::Node::Catalog::Compiler do end it "should gather data about itself" do - Puppet::Node::Catalog::Compiler.new + Puppet::Resource::Catalog::Compiler.new end it "should cache the server metadata and reuse it" do - compiler = Puppet::Node::Catalog::Compiler.new + compiler = Puppet::Resource::Catalog::Compiler.new node1 = stub 'node1', :merge => nil node2 = stub 'node2', :merge => nil compiler.stubs(:compile) @@ -31,16 +31,16 @@ describe Puppet::Node::Catalog::Compiler do end it "should provide a method for determining if the catalog is networked" do - compiler = Puppet::Node::Catalog::Compiler.new + compiler = Puppet::Resource::Catalog::Compiler.new compiler.should respond_to(:networked?) end end -describe Puppet::Node::Catalog::Compiler, " when creating the interpreter" do +describe Puppet::Resource::Catalog::Compiler, " when creating the interpreter" do before do # This gets pretty annoying on a plane where we have no IP address Facter.stubs(:value).returns("whatever") - @compiler = Puppet::Node::Catalog::Compiler.new + @compiler = Puppet::Resource::Catalog::Compiler.new end it "should not create the interpreter until it is asked for the first time" do @@ -57,10 +57,10 @@ describe Puppet::Node::Catalog::Compiler, " when creating the interpreter" do end end -describe Puppet::Node::Catalog::Compiler, " when finding nodes" do +describe Puppet::Resource::Catalog::Compiler, " when finding nodes" do before do Facter.stubs(:value).returns("whatever") - @compiler = Puppet::Node::Catalog::Compiler.new + @compiler = Puppet::Resource::Catalog::Compiler.new @name = "me" @node = mock 'node' @request = stub 'request', :key => @name, :options => {} @@ -74,12 +74,12 @@ describe Puppet::Node::Catalog::Compiler, " when finding nodes" do end end -describe Puppet::Node::Catalog::Compiler, " after finding nodes" do +describe Puppet::Resource::Catalog::Compiler, " after finding nodes" do before do Puppet.expects(:version).returns(1) Facter.expects(:value).with('fqdn').returns("my.server.com") Facter.expects(:value).with('ipaddress').returns("my.ip.address") - @compiler = Puppet::Node::Catalog::Compiler.new + @compiler = Puppet::Resource::Catalog::Compiler.new @name = "me" @node = mock 'node' @request = stub 'request', :key => @name, :options => {} @@ -103,13 +103,13 @@ describe Puppet::Node::Catalog::Compiler, " after finding nodes" do end end -describe Puppet::Node::Catalog::Compiler, " when creating catalogs" do +describe Puppet::Resource::Catalog::Compiler, " when creating catalogs" do before do Facter.stubs(:value).returns("whatever") env = stub 'environment', :name => "yay" Puppet::Node::Environment.stubs(:new).returns(env) - @compiler = Puppet::Node::Catalog::Compiler.new + @compiler = Puppet::Resource::Catalog::Compiler.new @name = "me" @node = Puppet::Node.new @name @node.stubs(:merge) diff --git a/spec/unit/indirector/catalog/yaml.rb b/spec/unit/indirector/catalog/yaml.rb index 717fb816c..5f233c91c 100755 --- a/spec/unit/indirector/catalog/yaml.rb +++ b/spec/unit/indirector/catalog/yaml.rb @@ -2,24 +2,24 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -require 'puppet/node/catalog' +require 'puppet/resource/catalog' require 'puppet/indirector/catalog/yaml' -describe Puppet::Node::Catalog::Yaml do +describe Puppet::Resource::Catalog::Yaml do it "should be a subclass of the Yaml terminus" do - Puppet::Node::Catalog::Yaml.superclass.should equal(Puppet::Indirector::Yaml) + Puppet::Resource::Catalog::Yaml.superclass.should equal(Puppet::Indirector::Yaml) end it "should have documentation" do - Puppet::Node::Catalog::Yaml.doc.should_not be_nil + Puppet::Resource::Catalog::Yaml.doc.should_not be_nil end it "should be registered with the catalog store indirection" do indirection = Puppet::Indirector::Indirection.instance(:catalog) - Puppet::Node::Catalog::Yaml.indirection.should equal(indirection) + Puppet::Resource::Catalog::Yaml.indirection.should equal(indirection) end it "should have its name set to :yaml" do - Puppet::Node::Catalog::Yaml.name.should == :yaml + Puppet::Resource::Catalog::Yaml.name.should == :yaml end end diff --git a/spec/unit/other/transaction.rb b/spec/unit/other/transaction.rb index 0db470d26..d2ac26869 100755 --- a/spec/unit/other/transaction.rb +++ b/spec/unit/other/transaction.rb @@ -6,7 +6,7 @@ require 'puppet/transaction' describe Puppet::Transaction, " when determining tags" do before do - @config = Puppet::Node::Catalog.new + @config = Puppet::Resource::Catalog.new @transaction = Puppet::Transaction.new(@config) end diff --git a/spec/unit/other/transbucket.rb b/spec/unit/other/transbucket.rb index e447c78a2..60efcdb87 100755 --- a/spec/unit/other/transbucket.rb +++ b/spec/unit/other/transbucket.rb @@ -130,14 +130,14 @@ describe Puppet::TransBucket, " when generating a catalog" do end it "should set each TransObject's catalog before converting to a RAL resource" do - @middleobj.expects(:catalog=).with { |c| c.is_a?(Puppet::Node::Catalog) } + @middleobj.expects(:catalog=).with { |c| c.is_a?(Puppet::Resource::Catalog) } @top.to_catalog end it "should set each TransBucket's catalog before converting to a RAL resource" do # each bucket is seen twice in the loop, so we have to handle the case where the config # is set twice - @bottom.expects(:catalog=).with { |c| c.is_a?(Puppet::Node::Catalog) }.at_least_once + @bottom.expects(:catalog=).with { |c| c.is_a?(Puppet::Resource::Catalog) }.at_least_once @top.to_catalog end end diff --git a/spec/unit/parser/compiler.rb b/spec/unit/parser/compiler.rb index bf50d8790..025836229 100755 --- a/spec/unit/parser/compiler.rb +++ b/spec/unit/parser/compiler.rb @@ -251,7 +251,7 @@ describe Puppet::Parser::Compiler do file2 = Puppet::Type.type(:file).create :path => "/foo" @compiler.add_resource(@scope, file1) - lambda { @compiler.add_resource(@scope, file2) }.should raise_error(Puppet::Node::Catalog::DuplicateResourceError) + lambda { @compiler.add_resource(@scope, file2) }.should raise_error(Puppet::Resource::Catalog::DuplicateResourceError) end it "should have a method for looking up resources" do diff --git a/spec/unit/node/catalog.rb b/spec/unit/resource/catalog.rb index 97674dfc2..27e6296c6 100755 --- a/spec/unit/node/catalog.rb +++ b/spec/unit/resource/catalog.rb @@ -2,34 +2,34 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe Puppet::Node::Catalog, " when compiling" do +describe Puppet::Resource::Catalog, " when compiling" do it "should accept tags" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") config.tag("one") config.tags.should == %w{one} end it "should accept multiple tags at once" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") config.tag("one", "two") config.tags.should == %w{one two} end it "should convert all tags to strings" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") config.tag("one", :two) config.tags.should == %w{one two} end it "should tag with both the qualified name and the split name" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") config.tag("one::two") config.tags.include?("one").should be_true config.tags.include?("one::two").should be_true end it "should accept classes" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") config.add_class("one") config.classes.should == %w{one} config.add_class("two", "three") @@ -37,22 +37,22 @@ describe Puppet::Node::Catalog, " when compiling" do end it "should tag itself with passed class names" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") config.add_class("one") config.tags.should == %w{one} end end -describe Puppet::Node::Catalog, " when extracting" do +describe Puppet::Resource::Catalog, " when extracting" do it "should return extraction result as the method result" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") config.expects(:extraction_format).returns(:whatever) config.expects(:extract_to_whatever).returns(:result) config.extract.should == :result end end -describe Puppet::Node::Catalog, " when extracting transobjects" do +describe Puppet::Resource::Catalog, " when extracting transobjects" do def mkscope @parser = Puppet::Parser::Parser.new :Code => "" @@ -69,7 +69,7 @@ describe Puppet::Node::Catalog, " when extracting transobjects" do end it "should always create a TransBucket for the 'main' class" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") @scope = mkscope @source = mock 'source' @@ -87,7 +87,7 @@ describe Puppet::Node::Catalog, " when extracting transobjects" do # This isn't really a spec-style test, but I don't know how better to do it. it "should transform the resource graph into a tree of TransBuckets and TransObjects" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") @scope = mkscope @source = mock 'source' @@ -108,7 +108,7 @@ describe Puppet::Node::Catalog, " when extracting transobjects" do # Now try it with a more complicated graph -- a three tier graph, each tier it "should transform arbitrarily deep graphs into isomorphic trees" do - config = Puppet::Node::Catalog.new("mynode") + config = Puppet::Resource::Catalog.new("mynode") @scope = mkscope @scope.stubs(:tags).returns([]) @@ -151,7 +151,7 @@ describe Puppet::Node::Catalog, " when extracting transobjects" do end end -describe Puppet::Node::Catalog, " when converting to a transobject catalog" do +describe Puppet::Resource::Catalog, " when converting to a transobject catalog" do class CatalogTestResource attr_accessor :name, :virtual, :builtin def initialize(name, options = {}) @@ -181,7 +181,7 @@ describe Puppet::Node::Catalog, " when converting to a transobject catalog" do end before do - @original = Puppet::Node::Catalog.new("mynode") + @original = Puppet::Resource::Catalog.new("mynode") @original.tag(*%w{one two three}) @original.add_class *%w{four five six} @@ -244,9 +244,9 @@ describe Puppet::Node::Catalog, " when converting to a transobject catalog" do end end -describe Puppet::Node::Catalog, " when converting to a RAL catalog" do +describe Puppet::Resource::Catalog, " when converting to a RAL catalog" do before do - @original = Puppet::Node::Catalog.new("mynode") + @original = Puppet::Resource::Catalog.new("mynode") @original.tag(*%w{one two three}) @original.add_class *%w{four five six} @@ -293,12 +293,12 @@ describe Puppet::Node::Catalog, " when converting to a RAL catalog" do end it "should convert parser resources to transobjects and set the catalog" do - catalog = Puppet::Node::Catalog.new("mynode") + catalog = Puppet::Resource::Catalog.new("mynode") result = mock 'catalog' result.stub_everything - Puppet::Node::Catalog.expects(:new).returns result + Puppet::Resource::Catalog.expects(:new).returns result trans = mock 'trans' resource = Puppet::Parser::Resource.new(:scope => mock("scope"), :source => mock("source"), :type => :file, :title => "/eh") @@ -316,7 +316,7 @@ describe Puppet::Node::Catalog, " when converting to a RAL catalog" do it "should not lose track of resources whose names vary" do changer = Puppet::TransObject.new 'changer', 'test' - config = Puppet::Node::Catalog.new('test') + config = Puppet::Resource::Catalog.new('test') config.add_resource(changer) config.add_resource(@top) @@ -340,9 +340,9 @@ describe Puppet::Node::Catalog, " when converting to a RAL catalog" do end end -describe Puppet::Node::Catalog, " when functioning as a resource container" do +describe Puppet::Resource::Catalog, " when functioning as a resource container" do before do - @catalog = Puppet::Node::Catalog.new("host") + @catalog = Puppet::Resource::Catalog.new("host") @one = Puppet::Type.type(:notify).create :name => "one" @two = Puppet::Type.type(:notify).create :name => "two" @dupe = Puppet::Type.type(:notify).create :name => "one" @@ -392,7 +392,7 @@ describe Puppet::Node::Catalog, " when functioning as a resource container" do it "should not allow two resources with the same resource reference" do @catalog.add_resource(@one) - proc { @catalog.add_resource(@dupe) }.should raise_error(Puppet::Node::Catalog::DuplicateResourceError) + proc { @catalog.add_resource(@dupe) }.should raise_error(Puppet::Resource::Catalog::DuplicateResourceError) end it "should ignore implicit resources that conflict with existing resources" do @@ -473,7 +473,7 @@ describe Puppet::Node::Catalog, " when functioning as a resource container" do it "should optionally support an initialization block and should finalize after such blocks" do @one.expects :finish @two.expects :finish - config = Puppet::Node::Catalog.new("host") do |conf| + config = Puppet::Resource::Catalog.new("host") do |conf| conf.add_resource @one conf.add_resource @two end @@ -599,9 +599,9 @@ describe Puppet::Node::Catalog, " when functioning as a resource container" do end end -describe Puppet::Node::Catalog do +describe Puppet::Resource::Catalog do before :each do - @catalog = Puppet::Node::Catalog.new("host") + @catalog = Puppet::Resource::Catalog.new("host") @catalog.retrieval_duration = Time.now @transaction = mock 'transaction' @@ -612,7 +612,7 @@ describe Puppet::Node::Catalog do end it "should be an Expirer" do - Puppet::Node::Catalog.ancestors.should be_include(Puppet::Util::Cacher::Expirer) + Puppet::Resource::Catalog.ancestors.should be_include(Puppet::Util::Cacher::Expirer) end it "should always be expired if it's not applying" do @@ -745,7 +745,7 @@ describe Puppet::Node::Catalog do after { Puppet.settings.clear } end - describe Puppet::Node::Catalog, " when applying non-host catalogs" do + describe Puppet::Resource::Catalog, " when applying non-host catalogs" do before do @catalog.host_config = false @@ -768,10 +768,10 @@ describe Puppet::Node::Catalog do end end -describe Puppet::Node::Catalog, " when creating a relationship graph" do +describe Puppet::Resource::Catalog, " when creating a relationship graph" do before do Puppet::Type.type(:component) - @catalog = Puppet::Node::Catalog.new("host") + @catalog = Puppet::Resource::Catalog.new("host") @compone = Puppet::Type::Component.create :name => "one" @comptwo = Puppet::Type::Component.create :name => "two", :require => ["class", "one"] @file = Puppet::Type.type(:file) @@ -856,9 +856,9 @@ describe Puppet::Node::Catalog, " when creating a relationship graph" do end end -describe Puppet::Node::Catalog, " when writing dot files" do +describe Puppet::Resource::Catalog, " when writing dot files" do before do - @catalog = Puppet::Node::Catalog.new("host") + @catalog = Puppet::Resource::Catalog.new("host") @name = :test @file = File.join(Puppet[:graphdir], @name.to_s + ".dot") end @@ -875,7 +875,7 @@ describe Puppet::Node::Catalog, " when writing dot files" do end end -describe Puppet::Node::Catalog, " when indirecting" do +describe Puppet::Resource::Catalog, " when indirecting" do before do @indirection = stub 'indirection', :name => :catalog @@ -883,13 +883,13 @@ describe Puppet::Node::Catalog, " when indirecting" do end it "should redirect to the indirection for retrieval" do - Puppet::Node::Catalog.stubs(:indirection).returns(@indirection) + Puppet::Resource::Catalog.stubs(:indirection).returns(@indirection) @indirection.expects(:find) - Puppet::Node::Catalog.find(:myconfig) + Puppet::Resource::Catalog.find(:myconfig) end it "should default to the 'compiler' terminus" do - Puppet::Node::Catalog.indirection.terminus_class.should == :compiler + Puppet::Resource::Catalog.indirection.terminus_class.should == :compiler end after do @@ -897,9 +897,9 @@ describe Puppet::Node::Catalog, " when indirecting" do end end -describe Puppet::Node::Catalog, " when converting to yaml" do +describe Puppet::Resource::Catalog, " when converting to yaml" do before do - @catalog = Puppet::Node::Catalog.new("me") + @catalog = Puppet::Resource::Catalog.new("me") @catalog.add_edge("one", "two") end @@ -908,9 +908,9 @@ describe Puppet::Node::Catalog, " when converting to yaml" do end end -describe Puppet::Node::Catalog, " when converting from yaml" do +describe Puppet::Resource::Catalog, " when converting from yaml" do before do - @catalog = Puppet::Node::Catalog.new("me") + @catalog = Puppet::Resource::Catalog.new("me") @catalog.add_edge("one", "two") text = YAML.dump(@catalog) @@ -918,7 +918,7 @@ describe Puppet::Node::Catalog, " when converting from yaml" do end it "should get converted back to a catalog" do - @newcatalog.should be_instance_of(Puppet::Node::Catalog) + @newcatalog.should be_instance_of(Puppet::Resource::Catalog) end it "should have all vertices" do diff --git a/spec/unit/transaction.rb b/spec/unit/transaction.rb index 2c1998587..0758e6c1e 100755 --- a/spec/unit/transaction.rb +++ b/spec/unit/transaction.rb @@ -9,7 +9,7 @@ describe Puppet::Transaction do @generator_class = mkgenerator @generator = mkgenerator.create(:name => "foo") - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @generator @report = stub_everything 'report' diff --git a/spec/unit/type.rb b/spec/unit/type.rb index 89a8e5e9c..a279e1139 100755 --- a/spec/unit/type.rb +++ b/spec/unit/type.rb @@ -8,7 +8,7 @@ describe Puppet::Type do end it "should use its catalog as its expirer" do - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new resource = Puppet::Type.type(:mount).create(:name => "foo", :fstype => "bar", :pass => 1, :ensure => :present) resource.catalog = catalog resource.expirer.should equal(catalog) @@ -67,7 +67,7 @@ describe Puppet::Type do describe "when in a catalog" do before do - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @container = Puppet::Type.type(:component).create(:name => "container") @one = Puppet::Type.type(:file).create(:path => "/file/one") @two = Puppet::Type.type(:file).create(:path => "/file/two") diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb index 0ab4f40bb..399181e6c 100755 --- a/spec/unit/type/file.rb +++ b/spec/unit/type/file.rb @@ -105,7 +105,7 @@ describe Puppet::Type.type(:file) do :path => @link, :mode => "755" ) - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @resource end @@ -186,7 +186,7 @@ describe Puppet::Type.type(:file) do stat = mock 'stat' File.expects(:lstat).returns stat - catalog = Puppet::Node::Catalog.new + catalog = Puppet::Resource::Catalog.new @resource.catalog = catalog catalog.stubs(:applying?).returns true diff --git a/spec/unit/type/mount.rb b/spec/unit/type/mount.rb index 7ddb7ea26..72028f312 100755 --- a/spec/unit/type/mount.rb +++ b/spec/unit/type/mount.rb @@ -196,7 +196,7 @@ describe Puppet::Type.type(:mount), "when modifying an existing mount entry" do @mount.provider.stubs(:mounted?).returns true - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @mount end diff --git a/spec/unit/type/package.rb b/spec/unit/type/package.rb index 13bf4d3d3..10d74d0b6 100755 --- a/spec/unit/type/package.rb +++ b/spec/unit/type/package.rb @@ -108,7 +108,7 @@ describe Puppet::Type.type(:package) do Puppet::Type.type(:package).defaultprovider.stubs(:instances).returns([]) @package = Puppet::Type.type(:package).create(:name => "yay") - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new @catalog.add_resource(@package) end diff --git a/spec/unit/type/ssh_authorized_key.rb b/spec/unit/type/ssh_authorized_key.rb index 3240b7a94..0e32ef77a 100755 --- a/spec/unit/type/ssh_authorized_key.rb +++ b/spec/unit/type/ssh_authorized_key.rb @@ -14,7 +14,7 @@ describe ssh_authorized_key do @provider = stub 'provider', :class => @provider_class, :file_path => "/tmp/whatever", :clear => nil @provider_class.stubs(:new).returns(@provider) - @catalog = Puppet::Node::Catalog.new + @catalog = Puppet::Resource::Catalog.new end it "should have a name parameter" do diff --git a/spec/unit/type/user.rb b/spec/unit/type/user.rb index 78bfa2e82..51b38186a 100755 --- a/spec/unit/type/user.rb +++ b/spec/unit/type/user.rb @@ -246,7 +246,7 @@ describe user do testrole = Puppet.type(:user).create(:name => "testrole") - config = Puppet::Node::Catalog.new :testing do |conf| + config = Puppet::Resource::Catalog.new :testing do |conf| [testuser, testrole].each { |resource| conf.add_resource resource } end diff --git a/spec/unit/type/zfs.rb b/spec/unit/type/zfs.rb index 08d6e0747..f36c715d2 100755 --- a/spec/unit/type/zfs.rb +++ b/spec/unit/type/zfs.rb @@ -34,7 +34,7 @@ describe zfs do foo_bar_baz_zfs = Puppet.type(:zfs).create(:name => "foo/bar/baz") foo_bar_baz_buz_zfs = Puppet.type(:zfs).create(:name => "foo/bar/baz/buz") - config = Puppet::Node::Catalog.new :testing do |conf| + config = Puppet::Resource::Catalog.new :testing do |conf| [foo_pool, foo_bar_zfs, foo_bar_baz_zfs, foo_bar_baz_buz_zfs].each { |resource| conf.add_resource resource } end diff --git a/test/language/snippets.rb b/test/language/snippets.rb index dfb914f72..a1d0f5d4f 100755 --- a/test/language/snippets.rb +++ b/test/language/snippets.rb @@ -498,7 +498,7 @@ class TestSnippets < Test::Unit::TestCase catalog = nil assert_nothing_raised("Could not compile catalog") { - catalog = Puppet::Node::Catalog.find(node) + catalog = Puppet::Resource::Catalog.find(node) } assert_nothing_raised("Could not convert catalog") { diff --git a/test/lib/puppettest/support/resources.rb b/test/lib/puppettest/support/resources.rb index 255c55569..045579302 100755 --- a/test/lib/puppettest/support/resources.rb +++ b/test/lib/puppettest/support/resources.rb @@ -25,7 +25,7 @@ module PuppetTest::Support::Resources end def mktree - catalog = Puppet::Node::Catalog.new do |config| + catalog = Puppet::Resource::Catalog.new do |config| one = treenode(config, "one", "a", "b") two = treenode(config, "two", "c", "d") middle = treenode(config, "middle", "e", "f", two) diff --git a/test/lib/puppettest/support/utils.rb b/test/lib/puppettest/support/utils.rb index 0d775d184..aa3ad8b8d 100644 --- a/test/lib/puppettest/support/utils.rb +++ b/test/lib/puppettest/support/utils.rb @@ -24,7 +24,7 @@ module PuppetTest::Support::Utils # Turn a list of resources, or possibly a catalog and some resources, # into a catalog object. def resources2catalog(*resources) - if resources[0].is_a?(Puppet::Node::Catalog) + if resources[0].is_a?(Puppet::Resource::Catalog) config = resources.shift unless resources.empty? resources.each { |r| config.add_resource r } @@ -34,7 +34,7 @@ module PuppetTest::Support::Utils comp = resources.shift comp.delve else - config = Puppet::Node::Catalog.new + config = Puppet::Resource::Catalog.new resources.each { |res| config.add_resource res } end return config @@ -159,7 +159,7 @@ module PuppetTest::Support::Utils else name = :testing end - config = Puppet::Node::Catalog.new :testing do |conf| + config = Puppet::Resource::Catalog.new :testing do |conf| resources.each { |resource| conf.add_resource resource } end diff --git a/test/network/handler/master.rb b/test/network/handler/master.rb index 8e55f104c..a802b0a0a 100755 --- a/test/network/handler/master.rb +++ b/test/network/handler/master.rb @@ -13,7 +13,7 @@ class TestMaster < Test::Unit::TestCase @master = Puppet::Network::Handler.master.new(:Manifest => tempfile) @catalog = stub 'catalog', :extract => "" - Puppet::Node::Catalog.stubs(:find).returns(@catalog) + Puppet::Resource::Catalog.stubs(:find).returns(@catalog) end def teardown @@ -53,7 +53,7 @@ class TestMaster < Test::Unit::TestCase @master.stubs(:decode_facts) - Puppet::Node::Catalog.expects(:find).with("foo.com").returns(@catalog) + Puppet::Resource::Catalog.expects(:find).with("foo.com").returns(@catalog) @master.getconfig("facts", "yaml", "foo.com") end @@ -68,7 +68,7 @@ class TestMasterFormats < Test::Unit::TestCase @master.stubs(:decode_facts) @catalog = stub 'catalog', :extract => "" - Puppet::Node::Catalog.stubs(:find).returns(@catalog) + Puppet::Resource::Catalog.stubs(:find).returns(@catalog) end def test_marshal_can_be_used diff --git a/test/other/transactions.rb b/test/other/transactions.rb index 04480c24c..931a4d4d1 100755 --- a/test/other/transactions.rb +++ b/test/other/transactions.rb @@ -346,7 +346,7 @@ class TestTransactions < Test::Unit::TestCase file[:group] = @groups[0] assert_apply(file) - config = Puppet::Node::Catalog.new + config = Puppet::Resource::Catalog.new fcomp = Puppet::Type.type(:component).create(:name => "file") config.add_resource fcomp config.add_resource file @@ -554,7 +554,7 @@ class TestTransactions < Test::Unit::TestCase end def test_ignore_tags? - config = Puppet::Node::Catalog.new + config = Puppet::Resource::Catalog.new config.host_config = true transaction = Puppet::Transaction.new(config) assert(! transaction.ignore_tags?, "Ignoring tags when applying a host catalog") @@ -566,7 +566,7 @@ class TestTransactions < Test::Unit::TestCase def test_missing_tags? resource = stub 'resource', :tagged? => true - config = Puppet::Node::Catalog.new + config = Puppet::Resource::Catalog.new # Mark it as a host config so we don't care which test is first config.host_config = true @@ -659,7 +659,7 @@ class TestTransactions < Test::Unit::TestCase end # Make a graph with some stuff in it. - graph = Puppet::Node::Catalog.new + graph = Puppet::Resource::Catalog.new # Add a non-triggering edge. a = trigger.new(:a) |