diff options
author | John Bellone <jbellone@bellone.us> | 2016-10-05 03:56:10 -0400 |
---|---|---|
committer | John Bellone <jbellone@bloomberg.net> | 2016-11-01 15:52:53 -0400 |
commit | a93d144763c7eaf68412144780fa674870f5ee0f (patch) | |
tree | 0b687d919d6061e49102c259566ed57a75bc57e0 | |
parent | a7145cdadc00041a6877d05e6deb0dbe42281b76 (diff) | |
download | chef-a93d144763c7eaf68412144780fa674870f5ee0f.tar.gz |
Add the policyfile revision_id as an automatic attribute.
/cc @coderanger @danielsdeleo
We have been looking for an easy way to get this value into our error
reporting application and it surprised me that it isn't already
captured. If there's a better way to do this totally open for thoughts!
Signed-off-by: John Bellone <jbellone@bloomberg.net>
-rw-r--r-- | lib/chef/policy_builder/policyfile.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb index 8d2437fef5..f0009eac6c 100644 --- a/lib/chef/policy_builder/policyfile.rb +++ b/lib/chef/policy_builder/policyfile.rb @@ -173,6 +173,7 @@ class Chef CookbookCacheCleaner.instance.skip_removal = true if named_run_list_requested? node.run_list(run_list) + node.automatic_attrs[:policy_revision] = revision_id node.automatic_attrs[:roles] = [] node.automatic_attrs[:recipes] = run_list_expansion_ish.recipes run_list_expansion_ish |