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

[JUJU-1705] Make sure the action status is correctly set #753

Merged
merged 3 commits into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions juju/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ class Action(model.ModelEntity):
def __init__(self, entity_id, model, history_index=-1, connected=True):
super().__init__(entity_id, model, history_index, connected)
self.results = {}
self._status = self.data['status']

@property
def status(self):
return self.data['status']
return self._status

async def fetch_output(self):
self.results = await self.model.get_action_output(self.id)
completed_action = await self.model._get_completed_action(self.id)
self.results = completed_action.output or {}
self._status = completed_action.status

async def wait(self):
self.results or await self.fetch_output()
Expand Down