Skip to content

Commit 070fc59

Browse files
committed
Fix run-actions on units
1 parent 3b22916 commit 070fc59

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

juju/action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ def status(self):
77
return self.data['status']
88

99
async def wait(self):
10-
return await self.model.wait_for_action(self.id)
10+
return await self.model.get_action_output(self.id)

juju/unit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,19 @@ async def run_action(self, action_name, **params):
164164

165165
log.debug('Starting action `%s` on %s', action_name, self.name)
166166

167-
res = await action_facade.Enqueue(actions=[client.Action(
167+
res = await action_facade.EnqueueOperation(actions=[client.Action(
168168
name=action_name,
169169
parameters=params,
170170
receiver=self.tag,
171171
)])
172-
action = res.results[0].action
173-
error = res.results[0].error
172+
action = res.actions[0].result
173+
error = res.actions[0].error
174174
if error and error.code == 'not found':
175175
raise ValueError('Action `%s` not found on %s' % (action_name,
176176
self.name))
177177
elif error:
178178
raise Exception('Unknown action error: %s' % error.serialize())
179-
action_id = action.tag[len('action-'):]
179+
action_id = action[len('action-'):]
180180
log.debug('Action started as %s', action_id)
181181
# we mustn't use wait_for_action because that blocks until the
182182
# action is complete, rather than just being in the model

0 commit comments

Comments
 (0)