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

(bug) Handle malformed _error values in task result in Orchestrator #2723

Merged
merged 1 commit into from Mar 23, 2021

Conversation

lucywyman
Copy link
Contributor

Previously, we assumed that if a task returned with an _error key that
it would be a hash and include the details key, and that that
details key would also have a hash value. Any of these assumptions
might be wrong. This amends the Orchestrator transport to handle
_error values that:

  • Are not a hash, by placing the provided value under the message key
  • Is a hash that doesn't have the details key by setting the details
    key to an empty hash
  • Is a hash with a details key that is not itself a hash by not trying
    to merge our own keys into it.

!bug

  • Handle malformed _error values in task results in Orchestrator

    Bolt now handles _error from task results in the Orchestrator
    transport when the value of the key is not a hash, does not include the
    details key, or the details key is not a hash. Previously Bolt would
    error if any of these conditions was true.

lib/bolt/transport/orch.rb Outdated Show resolved Hide resolved
Previously, we assumed that if a task returned with an `_error` key that
it would be a hash and include the `details` key, and that that
`details` key would also have a hash value. Any of these assumptions
might be wrong. This amends the Orchestrator transport to handle
`_error` values that:
* Are not a hash, by placing the provided value under the `message` key
* Is a hash that doesn't have the `details` key by setting the details
  key to an empty hash
* Is a hash with a `details` key that is not itself a hash by not trying
  to merge our own keys into it.

!bug

* **Handle malformed `_error` values in task results in Orchestrator**

  Bolt now handles `_error` from task results in the Orchestrator
  transport when the value of the key is not a hash, does not include the
  `details` key, or the `details` key is not a hash. Previously Bolt would
  error if any of these conditions was true.
@lucywyman lucywyman marked this pull request as ready for review March 18, 2021 18:00
@lucywyman lucywyman requested a review from a team as a code owner March 18, 2021 18:00
@lucywyman lucywyman added this to 🚧 Reviewing in Bolt Kanban via automation Mar 18, 2021
@lucywyman
Copy link
Contributor Author

Verified this isn't an issue over SSH, Windows, or Docker

@beechtom beechtom merged commit fe64a9d into puppetlabs:main Mar 23, 2021
@beechtom beechtom removed this from 🚧 Reviewing in Bolt Kanban Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants