summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/network/handler/resource.rb4
-rw-r--r--lib/puppet/parser/configuration.rb17
2 files changed, 18 insertions, 3 deletions
diff --git a/lib/puppet/network/handler/resource.rb b/lib/puppet/network/handler/resource.rb
index ca492bd81..ac29dce53 100755
--- a/lib/puppet/network/handler/resource.rb
+++ b/lib/puppet/network/handler/resource.rb
@@ -26,7 +26,7 @@ class Puppet::Network::Handler
# Apply a TransBucket as a transaction.
def apply(bucket, format = "yaml", client = nil, clientip = nil)
- unless @local
+ unless local?
begin
case format
when "yaml":
@@ -43,7 +43,7 @@ class Puppet::Network::Handler
# 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(:Server => client||"localhost")
+ client = Puppet::Network::Client.client(:Master).new(:Master => client||"localhost")
# Set the objects
client.objects = component
diff --git a/lib/puppet/parser/configuration.rb b/lib/puppet/parser/configuration.rb
index 26553d443..ea784da05 100644
--- a/lib/puppet/parser/configuration.rb
+++ b/lib/puppet/parser/configuration.rb
@@ -344,8 +344,23 @@ class Puppet::Parser::Configuration
end
end
- # Clear the cache to encourage the GC
+ # Retrive the bucket for the top-level scope and set the appropriate metadata.
result = buckets[topscope]
+ case topscope.type
+ when "": result.type = "main"
+ when nil: devfail "A Scope with no type"
+ else
+ result.type = topscope.type
+ end
+ if topscope.name
+ result.name = topscope.name
+ end
+
+ unless classlist.empty?
+ result.classes = classlist
+ end
+
+ # Clear the cache to encourage the GC
buckets.clear
return result
end