Skip to content

Commit bfcbc0b

Browse files
committed
Make sure the action status is correctly set
fixes #719
1 parent 0afe0d6 commit bfcbc0b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

juju/action.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ class Action(model.ModelEntity):
66
def __init__(self, entity_id, model, history_index=-1, connected=True):
77
super().__init__(entity_id, model, history_index, connected)
88
self.results = {}
9+
self._status = self.data['status']
910

1011
@property
1112
def status(self):
12-
return self.data['status']
13+
return self._status
1314

1415
async def fetch_output(self):
15-
self.results = await self.model.get_action_output(self.id)
16+
completed_action = await self.model._get_completed_action(self.id)
17+
self.results = completed_action.output
18+
self._status = completed_action.status
1619

1720
async def wait(self):
1821
self.results or await self.fetch_output()

0 commit comments

Comments
 (0)