canonical / charm-microceph

Charm to deploy/manage microceph
Apache License 2.0
2 stars 9 forks source link

Add error message in action failure to results #75

Closed hemanthnakkina closed 4 months ago

hemanthnakkina commented 4 months ago

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: