diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-22 15:04:34 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-22 15:04:34 -0500 |
| commit | d6e91ae78698bdbec818d383574f4c279735e172 (patch) | |
| tree | 7072c2a71ef1c05c6a46b6050f52bf3d01ae2843 /lib/puppet/network/handler | |
| parent | a66699596452f88d2bc467af4cff3f9a1aec3d1e (diff) | |
| parent | 86dde63473d29c45d8698ce4edd53c820a621362 (diff) | |
| download | puppet-d6e91ae78698bdbec818d383574f4c279735e172.tar.gz puppet-d6e91ae78698bdbec818d383574f4c279735e172.tar.xz puppet-d6e91ae78698bdbec818d383574f4c279735e172.zip | |
Merge branch 'configurations' into indirection
Conflicts:
lib/puppet/defaults.rb
lib/puppet/indirector/facts/yaml.rb
spec/unit/indirector/indirection.rb
spec/unit/indirector/indirector.rb
Diffstat (limited to 'lib/puppet/network/handler')
| -rwxr-xr-x | lib/puppet/network/handler/fileserver.rb | 5 | ||||
| -rw-r--r-- | lib/puppet/network/handler/master.rb | 2 | ||||
| -rwxr-xr-x | lib/puppet/network/handler/resource.rb | 13 | ||||
| -rwxr-xr-x | lib/puppet/network/handler/runner.rb | 4 |
4 files changed, 10 insertions, 14 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index 993e9d51a..11cb17a90 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -243,7 +243,10 @@ class Puppet::Network::Handler # the modules. def modules_mount(module_name, client) # Find our environment, if we have one. - if node = Puppet::Node.get(client || Facter.value("hostname")) + unless hostname = (client || Facter.value("hostname")) + raise ArgumentError, "Could not find hostname" + end + if node = Puppet::Node.find(hostname) env = node.environment else env = nil diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index 9550dd550..030950c61 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -74,7 +74,7 @@ class Puppet::Network::Handler client, clientip = clientname(client, clientip, facts) # Pass the facts to the fact handler - Puppet::Node::Facts.post(Puppet::Node::Facts.new(client, facts)) + Puppet::Node::Facts.new(client, facts).save # And get the configuration from the config handler begin diff --git a/lib/puppet/network/handler/resource.rb b/lib/puppet/network/handler/resource.rb index ac29dce53..7709b85fe 100755 --- a/lib/puppet/network/handler/resource.rb +++ b/lib/puppet/network/handler/resource.rb @@ -39,21 +39,14 @@ class Puppet::Network::Handler end end - component = bucket.to_type - - # Create a client, but specify the remote machine as the server - # because the class requires it, even though it's unused - client = Puppet::Network::Client.client(:Master).new(:Master => client||"localhost") - - # Set the objects - client.objects = component + config = bucket.to_configuration # And then apply the configuration. This way we're reusing all # the code in there. It should probably just be separated out, though. - transaction = client.apply + transaction = config.apply # And then clean up - component.remove + config.clear(true) # It'd be nice to return some kind of report, but... at this point # we have no such facility. diff --git a/lib/puppet/network/handler/runner.rb b/lib/puppet/network/handler/runner.rb index c41e83608..4b9ccab75 100755 --- a/lib/puppet/network/handler/runner.rb +++ b/lib/puppet/network/handler/runner.rb @@ -50,10 +50,10 @@ class Puppet::Network::Handler # And then we need to tell it to run, with this extra info. if fg - master.run(tags, ignoreschedules) + master.run(:tags => tags, :ignoreschedules => ignoreschedules) else Puppet.newthread do - master.run(tags, ignoreschedules) + master.run(:tags => tags, :ignoreschedules => ignoreschedules) end end |
