Skip to content
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

Adding Inspectme functionality into log_object embedded method. #386

Merged
merged 1 commit into from
Aug 14, 2018

Conversation

billfitzgerald0120
Copy link
Contributor

Added the ability to log all attributes, associations, and tags.
Inspectme is a great tool for debugging and now will be available from an embedded method.

#350

@billfitzgerald0120
Copy link
Contributor Author

@miq-bot add_label enhancement

@billfitzgerald0120
Copy link
Contributor Author

Spec is still a work in progress ....

@miq-bot miq-bot added the wip label Aug 2, 2018
@billfitzgerald0120 billfitzgerald0120 changed the title [WIP] Adding Inspectme functionality into log_object embedded method. Adding Inspectme functionality into log_object embedded method. Aug 3, 2018
@billfitzgerald0120
Copy link
Contributor Author

@tinaafitz @mkanoor Please review

@miq-bot miq-bot removed the wip label Aug 3, 2018
@@ -42,6 +42,48 @@ def self.log(obj, object_string = 'Automation Object', handle = $evm)
obj.attributes.sort.each { |k, v| handle.log("info", " Attribute - #{k}: #{v}") }
handle.log("info", "Listing #{object_string} Attributes - End")
end

def self.log_ar_objects(object_string = 'VMDB Object', handle = $evm)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120 I think instead of using object_string we should call it log_prefix.

handle.log("info", "Listing #{log_prefix} Attributes - End")
end

def self.ar_object?(obj)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120
can we change this whole method to

def self.ar_object?(obj)
   obj.respond_to?(:object_class)
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkanoor The changes worked so I am updating PR. Thanks

Added the ability to log all attributes, associations, and tags.
Inspectme is a great tool for debugging and now will be available from an embedded method.

ManageIQ#350

Added tests
Changed object_prefix to log_prefix as requested.

Changed method to obj.respond_to?(:object_class) as requested.
@miq-bot
Copy link
Member

miq-bot commented Aug 13, 2018

Checked commit billfitzgerald0120@3295adc with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@billfitzgerald0120
Copy link
Contributor Author

@mkanoor Please review

@mkanoor mkanoor merged commit fa9781b into ManageIQ:master Aug 14, 2018
@mkanoor mkanoor added this to the Sprint 93 Ending Aug 27, 2018 milestone Aug 14, 2018
@gmcculloug
Copy link
Member

@billfitzgerald0120 Now that this code is merged are you working on updating the inspectme method to use these embedded methods? There were other places we wanted to including these embedded method to reduce code duplication. Any progress toward that?

@billfitzgerald0120
Copy link
Contributor Author

@gmcculloug I will work on updating the inspectme method. Still looking into where else we want to use the embedded methods to reduce code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants