diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-28 15:17:56 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-28 15:17:56 +0000 |
| commit | ad1396d3d960b805d3f9510d105937b6854deb90 (patch) | |
| tree | 45381379838abdd7a8753f5c5dc68713662d3b07 | |
| parent | 5be3c107fa1c81c26e379eb900f780589ccffa04 (diff) | |
| download | puppet-ad1396d3d960b805d3f9510d105937b6854deb90.tar.gz puppet-ad1396d3d960b805d3f9510d105937b6854deb90.tar.xz puppet-ad1396d3d960b805d3f9510d105937b6854deb90.zip | |
Fixing backgrounding in puppetrun; I had the bit flipped between the client and the server, such that setting --foreground caused the clients to go into the background.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1325 980ebf18-57e1-0310-9a29-db15c13687c0
| -rwxr-xr-x | lib/puppet/server/runner.rb | 9 | ||||
| -rwxr-xr-x | test/server/runner.rb | 24 |
2 files changed, 16 insertions, 17 deletions
diff --git a/lib/puppet/server/runner.rb b/lib/puppet/server/runner.rb index d53b6c9b1..079197751 100755 --- a/lib/puppet/server/runner.rb +++ b/lib/puppet/server/runner.rb @@ -10,7 +10,7 @@ class Server # Run the client configuration right now, optionally specifying # tags and whether to ignore schedules - def run(tags = [], ignoreschedules = false, bg = true, client = nil, clientip = nil) + def run(tags = [], ignoreschedules = false, fg = true, client = nil, clientip = nil) # We need to retrieve the client master = Puppet::Client::MasterClient.instance @@ -45,13 +45,12 @@ class Server end # And then we need to tell it to run, with this extra info. - # By default, stick it in a thread - if bg + if fg + master.run(tags, ignoreschedules) + else Puppet.newthread do master.run(tags, ignoreschedules) end - else - master.run(tags, ignoreschedules) end return "success" diff --git a/test/server/runner.rb b/test/server/runner.rb index 19c08e558..59487776f 100755 --- a/test/server/runner.rb +++ b/test/server/runner.rb @@ -62,33 +62,33 @@ class TestServerRunner < Test::Unit::TestCase # Fourth: whether file should exist true/false [ ["with no backgrounding", - nil, true, false, true], # no backgrounding + nil, true, true, true], ["in the background", - nil, true, true, true], # in the background + nil, true, false, true], ["with a bad tag", - ["coolness"], true, true, false], # a bad tag + ["coolness"], true, false, false], ["with another bad tag", - "coolness", true, true, false], # another bad tag + "coolness", true, false, false], ["with a good tag", - ["coolness", "yayness"], true, true, true], # a good tag + ["coolness", "yayness"], true, false, true], ["with another good tag", - ["yayness"], true, true, true], # another good tag + ["yayness"], true, false, true], ["with a third good tag", - "yayness", true, true, true], # another good tag + "yayness", true, false, true], ["not ignoring schedules", - nil, false, true, false], # do not ignore schedules + nil, false, false, false], ["ignoring schedules", - nil, true, true, true], # ignore schedules - ].each do |msg, tags, ignore, bg, shouldexist| + nil, true, false, true], + ].each do |msg, tags, ignore, fg, shouldexist| if FileTest.exists?(created) File.unlink(created) end assert_nothing_raised { # Try it without backgrounding - runner.run(tags, ignore, bg) + runner.run(tags, ignore, fg) } - if bg + unless fg Puppet.join end |
