Current event.fail(message) adds the message to
Action object outside results. However pylibjuju
returns results dict out of action object in the
function get_action_output. So add the error
message to results dict within action object.
[x] Bug fix (non-breaking change which fixes an issue)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
This is a breaking change since any existing tools that reads action failure output should look for error message in results dict instead of directly on action object. If needed, we can add the message at both places but it makes sense to put the error message in results dict which has return-code as well.
How Has This Been Tested?
Unit tests are updated.
Also tested with deploying microceph using charm.
Contributor's Checklist
Please check that you have:
[x] self-reviewed the code in this PR.
[ ] added code comments, particularly in hard-to-understand areas.
[ ] updated the user documentation with corresponding changes.
[x] added tests to verify effectiveness of this change.
Description
Current event.fail(message) adds the message to Action object outside results. However pylibjuju returns results dict out of action object in the function get_action_output. So add the error message to results dict within action object.
Fixes # https://bugs.launchpad.net/charm-microceph/+bug/2025736
Type of change
Please delete options that are not relevant.
This is a breaking change since any existing tools that reads action failure output should look for error message in results dict instead of directly on action object. If needed, we can add the message at both places but it makes sense to put the error message in results dict which has return-code as well.
How Has This Been Tested?
Unit tests are updated. Also tested with deploying microceph using charm.
Contributor's Checklist
Please check that you have: