-
Notifications
You must be signed in to change notification settings - Fork 120
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
Created log_object method in System/CommonMethods/Utils class. #362
Conversation
$evm.log("info", "") | ||
end | ||
|
||
dump_root |
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.
Since the goal is to use this as an embedded method we do not want the method to be called from here. The automate method that embeds it would inject the call where needed.
Also need to consider moving it to another namespace in Automate where other common embedded methods would live.
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.
@billfitzgerald0120 Can we add a new class for these types of utilities in /System/CommonMethods/Utils?
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.
@billfitzgerald0120 The method should have the module information.
module Automate
module System
module CommonMethods
module Utils
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.
@billfitzgerald0120 Can we add the module information and move this method to the new class /System/CommonMethods/Utils?
# Description: Log all attributes stored in the $evm.root hash. | ||
# | ||
|
||
def dump_root |
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.
@billfitzgerald0120 to aid in testing we need to be able to inject dependencies. we won't have a $evm when we test
so this might be a better way of accomplishing the same thing
def dump_root(handle = $evm)
handle.log("info", "Root:<handle.root> Attributes - Begin")
handle.root.attributes.sort.each { |k, v| handle.log("info", " Attribute - #{k}: #{v}") }
handle.log("info", "Root:<handle.root> Attributes - End")
handle.log("info", "")
end
05e9751
to
6b003e4
Compare
@billfitzgerald0120 can you add a spec for this. |
# Description: Log all attributes stored in the $evm.root hash. | ||
# | ||
|
||
def dump_root(handle = $evm) |
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.
@billfitzgerald0120 this needs the modules and also the name of a class preferably Utils.
And the dump_root should be a class method
def self.dump_root(handle = $evm)
....
end
6b003e4
to
cf3591e
Compare
cf3591e
to
d04360a
Compare
@billfitzgerald0120 The branch this is built on is |
@gmcculloug @mkanoor @tinaafitz Madhu and I changed dump_root to log_object yesterday. I will change this to WIP. We need to discuss with Tina and Madhu. |
I totally misread the code change, I see now what you are doing. Sorry about that. 😊 |
@tinaafitz Please Review |
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.
@billfitzgerald0120 Looks good.
@mkanoor Please review.
This is a new method which can then be included into the other methods using the Embedded method feature. Created System/CommonMethods/Utils class. ManageIQ#350 Changed name to LogObject and many other changes ..... Added documentation in the method Fixed extra line Fixed rubocop errors in spec
d04360a
to
10f0ca6
Compare
Checked commit billfitzgerald0120@10f0ca6 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
This is a new method which can then be included into the other methods using the Embedded method feature. Originally this was dump_root but the name was changed to log_object.
This method will allow logging of root, current and any object passed to it.
#350
@miq-bot add_label enhancement
@miq-bot assign @gmcculloug