Commit 650bc7e0 authored by Ken Barber's avatar Ken Barber Committed by Ryan Senior

(PDB-16) Include warning when environment doesn't exist in report

This throws a warning if users are suffering from bug PUP-2508.
Signed-off-by: default avatarKen Barber <>
parent 890f31ee
......@@ -34,6 +34,10 @@ Puppet::Reports.register_report(:puppetdb) do
# @api private
def report_to_hash
profile "Convert report to wire format hash" do
if environment.nil?
raise Puppet::Error, "Environment is nil, unable to submit report. This may be due a bug with Puppet. Ensure you are running the latest revision, see PUP-2508 for more details."
"certname" => host,
"puppet-version" => puppet_version,
......@@ -15,13 +15,7 @@ describe processor do
subject {
s ="foo").extend(processor)
s.configuration_version = 123456789
# For backwards compatibility with versions of Puppet that don't
# have an accessor method for the report_format variable
if !s.respond_to?(:report_format)
s.environment = "foo"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment