-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide option to avoid saving the inspec attributes to the node object #374
Conversation
nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this so much. Thank you.
# Copies ['audit']['attributes'] into run_state for the audit_handler to read them later | ||
# Deletes ['audit']['attributes'] if instructed by ['audit']['attributes_save'] | ||
def copy_audit_attributes | ||
node.run_state['audit_attributes'] = node['audit']['attributes'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmmmm....yasss.
@@ -41,7 +41,8 @@ def report | |||
end | |||
quiet = node['audit']['quiet'] | |||
fetcher = node['audit']['fetcher'] | |||
attributes = node['audit']['attributes'].to_h | |||
|
|||
attributes = node.run_state['audit_attributes'].to_h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going from a Mash to a Hash going to cause any issues? (I know it was a .to_h
before, but I'm curious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nobody reported issues with it and tests are showing the expected values.
Signed-off-by: Alex Pop <alexpop@users.noreply.github.com>
Signed-off-by: Alex Pop <alexpop@users.noreply.github.com>
5dc94ee
to
6dd9a31
Compare
Jerry and Victoria, thank you for the reviews! |
Signed-off-by: Alex Pop <alexpop@users.noreply.github.com>
Introducing a new cookbook attribute
['audit']['attributes_save']
to remove['audit']['attributes']
from the node object if needed.Thank you @trickyearlobe for the feedback!
Opening the PR for now while working on tests