summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-03-13 18:23:04 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-03-20 18:27:08 +1100
commitb6116fe28d9c771dbe2dcded539bcf30eea552a3 (patch)
treef75130ab70354a266f860e772b20e31bbd9fe289 /lib
parent15740fe090365a81202fd44244e88b976f1d14d7 (diff)
downloadpuppet-b6116fe28d9c771dbe2dcded539bcf30eea552a3.tar.gz
puppet-b6116fe28d9c771dbe2dcded539bcf30eea552a3.tar.xz
puppet-b6116fe28d9c771dbe2dcded539bcf30eea552a3.zip
Requests now use default environment when none is specified
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/indirector/request.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/puppet/indirector/request.rb b/lib/puppet/indirector/request.rb
index 450b43bd2..3f7d1c554 100644
--- a/lib/puppet/indirector/request.rb
+++ b/lib/puppet/indirector/request.rb
@@ -9,7 +9,7 @@ class Puppet::Indirector::Request
attr_accessor :server, :port, :uri, :protocol
- attr_reader :environment, :indirection_name
+ attr_reader :indirection_name
# Is this an authenticated request?
def authenticated?
@@ -17,6 +17,13 @@ class Puppet::Indirector::Request
! ! authenticated
end
+ def environment
+ unless defined?(@environment) and @environment
+ @environment = Puppet::Node::Environment.new()
+ end
+ @environment
+ end
+
def environment=(env)
@environment = if env.is_a?(Puppet::Node::Environment)
env