cookbook 'debug_attributes', '~> 0.1.0'
debug_attributes (1) Versions 0.1.0 Follow0
Lets you see where attributes are getting set
cookbook 'debug_attributes', '~> 0.1.0', :supermarket
knife supermarket install debug_attributes
knife supermarket download debug_attributes
debug_attributes
Ever been frustrated by a bunch of Chef cookbooks which are linked in complex ways with complex attribute precedence?
Ever had to fill those cookbooks with Log and Pry statements to track down the culprit?
If so, this cookbook may be for you.
It installs an event handler so it can notify you each time an attribute is set.
Don't worry, it doesn't log the initial OHAI automatic attribute set
Usage
Add debug_attributes
to your runlist (No settings to set, no default recipe to call)
Run your code and get output like this
Starting Chef Infra Client, version 16.0.287
Using policy 'debug_attributes' at revision 'c0ea3d7128c801cf1fedd3ee539de091d3c629c3618be3580eb56a5c29908490'
resolving cookbooks for run list: ["debug_attributes_test::default@0.1.0 (138e5eb)"]
Synchronizing Cookbooks:
- debug_attributes (0.1.0)
- debug_attributes_test (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
[2020-05-13T21:26:50+00:00] WARN: ----------------------------------------------
[2020-05-13T21:26:50+00:00] WARN: | Registering attribute event handler |
[2020-05-13T21:26:50+00:00] WARN: ----------------------------------------------
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: default["debug_attributes_test"]={}
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/attributes/default.rb:1:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: default["debug_attributes_test", "test_attribute"]=Initial set at default level
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/attributes/default.rb:1:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: default["debug_attributes_test", "test_attribute"]=Second set at default level
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/attributes/default.rb:2:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: default["debug_attributes_test", "test_attribute"]=Third set at default level
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/recipes/default.rb:7:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: normal["debug_attributes_test", "test_attribute"]=Fourth set at normal level
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/recipes/default.rb:8:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: override["debug_attributes_test"]={}
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/recipes/default.rb:9:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: override["debug_attributes_test", "test_attribute"]=Fifth set at override level
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/recipes/default.rb:9:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: normal["debug_attributes_test", "test_attribute"]=Sixth set at normal level
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/recipes/default.rb:10:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: default["sasquatch"]={}
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes/recipes/default.rb:7:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/recipes/default.rb:12:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: Attribute changed:
[2020-05-13T21:26:50+00:00] WARN: default["sasquatch", "tracker"]=crazy
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes/recipes/default.rb:7:in `from_file'
[2020-05-13T21:26:50+00:00] WARN: /tmp/kitchen/cache/cookbooks/debug_attributes_test/recipes/default.rb:12:in `from_file'
Converging 0 resources
Running handlers:
Running handlers complete
Chef Infra Client finished, 0/0 resources updated in 01 seconds
Downloading files from
Finished converging (0m9.02s).
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC067: Ensure at least one platform supported in metadata: debug_attributes/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC067: Ensure at least one platform supported in metadata: debug_attributes/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 passed this metric