Fixing #540. I modified Puppet::Network::Client::Master so that it disables noop during its run, so that facts and plugins will always be downloaded.

git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2285 980ebf18-57e1-0310-9a29-db15c13687c0
This commit is contained in:
luke 2007-03-17 23:11:45 +00:00
Родитель 86c63ce2d9
Коммит 8387d48a42
2 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -356,6 +356,9 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
Puppet.info "Retrieving #{args[:name]}s"
noop = Puppet[:noop]
Puppet[:noop] = false
begin
trans = objects.evaluate
trans.ignoretags = true
@ -381,6 +384,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
# Now clean up after ourselves
objects.remove
files
ensure
Puppet[:noop] = noop
end
# Retrieve facts from the central server.

Просмотреть файл

@ -39,6 +39,11 @@ class TestMasterClient < Test::Unit::TestCase
end
end
def setup
super
@master = Puppet::Network::Client.master
end
def mkmaster(file = nil)
master = nil
@ -525,6 +530,21 @@ end
assert(Puppet::Type.type(:schedule)["hourly"], "Could not retrieve hourly schedule")
assert(Puppet::Type.type(:filebucket)["puppet"], "Could not retrieve default bucket")
end
# #540 - make sure downloads aren't affected by noop
def test_download_in_noop
source = tempfile
File.open(source, "w") { |f| f.puts "something" }
dest = tempfile
Puppet[:noop] = true
assert_nothing_raised("Could not download in noop") do
@master.download(:dest => dest, :source => source, :tag => "yay")
end
assert(FileTest.exists?(dest), "did not download in noop mode")
assert(Puppet[:noop], "noop got disabled in run")
end
end
# $Id$