Skip to content

Commit d940c2c

Browse files
committed
Fix ssh await and fix integration test
1 parent 74f2b04 commit d940c2c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

juju/unit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def set_meter_status(self):
222222
"""
223223
raise NotImplementedError()
224224

225-
def ssh(
225+
async def ssh(
226226
self, command, user=None, proxy=False, ssh_opts=None):
227227
"""Execute a command over SSH on this unit.
228228
@@ -232,7 +232,7 @@ def ssh(
232232
:param str ssh_opts: Additional options to the `ssh` command
233233
234234
"""
235-
self.machine.ssh(command, user, proxy, ssh_opts)
235+
return await self.machine.ssh(command, user, proxy, ssh_opts)
236236

237237
def status_history(self, num=20, utc=False):
238238
"""Get status history for this unit.

tests/integration/test_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def test_juju_api_error(event_loop):
1818

1919
async with base.CleanModel() as model:
2020
with pytest.raises(JujuAPIError):
21-
await model.add_machine(constraints={'mem': 'foo'})
21+
await model.add_machine(constraints={'mem': -50})
2222

2323

2424
@base.bootstrapped

0 commit comments

Comments
 (0)