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

(GH-147) Refactor Invocation methods to use shared helper and write error logs when appropriate #152

Conversation

david22swan
Copy link
Member

@david22swan david22swan commented Jun 17, 2021

should_to_resource renamed too invocable_resource in order to better represent what the method does at a glance and help to ease the understanding of the module.
Logic shared between invoke_get_method and invoke_set_method has been moved into a new method, invoke_dsc_resource. Said logic has in turn been hardened so that it now throws an error and returns nill should any of the following occur:

  • if the logon has previously failed
  • if nothing is returned from the execution
  • if the json cannot be parsed

@david22swan david22swan self-assigned this Jun 17, 2021
@david22swan david22swan added enhancement New feature or request and removed feature labels Jun 17, 2021
@david22swan david22swan force-pushed the GH-147/main/refactor-invocaton-methods branch 9 times, most recently from f5b3a07 to 9aecaa3 Compare June 18, 2021 15:13
Update the methods name in order to give greater clarity to anyone looking into the code
@david22swan david22swan force-pushed the GH-147/main/refactor-invocaton-methods branch 2 times, most recently from fd82f41 to 85e4bc1 Compare June 22, 2021 14:14
@michaeltlombardi michaeltlombardi changed the title (GH-147) Invocation methods refactored to use shared helper method (GH-147) Refactor Invocation methods to use shared helper Jun 22, 2021
@michaeltlombardi michaeltlombardi changed the title (GH-147) Refactor Invocation methods to use shared helper (GH-147) Refactor Invocation methods to use shared helper and write error logs when appropriate Jun 22, 2021
… method

A new method `invoke_dsc_resource` has been created that handles the calling and error handling for both invocation methods
@david22swan david22swan force-pushed the GH-147/main/refactor-invocaton-methods branch from 85e4bc1 to 56108b2 Compare June 22, 2021 14:41
@michaeltlombardi michaeltlombardi marked this pull request as ready for review June 22, 2021 14:50
@michaeltlombardi michaeltlombardi requested a review from a team as a code owner June 22, 2021 14:50
@michaeltlombardi michaeltlombardi merged commit a97be0a into puppetlabs:main Jun 22, 2021
@david22swan david22swan deleted the GH-147/main/refactor-invocaton-methods branch June 24, 2021 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants