Skip to content

Commit

Permalink
events: fix calling mgmt.Events from VM
Browse files Browse the repository at this point in the history
asyncio.create_subprocess_exec expects program and arguments directly,
not as a list.
  • Loading branch information
marmarek committed Jun 25, 2017
1 parent c545c95 commit ce7d486
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion qubesadmin/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def cleanup_func():
writer.close()
elif self.app.qubesd_connection_type == 'qrexec':
proc = yield from asyncio.create_subprocess_exec(
['qrexec-client-vm', dest, 'admin.Events'],
'qrexec-client-vm', dest, 'admin.Events',
stdin=subprocess.PIPE, stdout=subprocess.PIPE)

proc.stdin.write_eof()
Expand Down
8 changes: 4 additions & 4 deletions qubesadmin/tests/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def test_022_get_events_reader_remote(self):
task = asyncio.ensure_future(self.dispatcher._get_events_reader())
loop.run_until_complete(task)
self.assertEqual(mock_proc.mock_calls, [
unittest.mock.call(['qrexec-client-vm', 'dom0',
'admin.Events'], stdin=subprocess.PIPE,
unittest.mock.call('qrexec-client-vm', 'dom0',
'admin.Events', stdin=subprocess.PIPE,
stdout=subprocess.PIPE),
unittest.mock.call().stdin.write_eof()
])
Expand All @@ -224,8 +224,8 @@ def test_023_get_events_reader_remote_vm(self):
task = asyncio.ensure_future(self.dispatcher._get_events_reader(vm))
loop.run_until_complete(task)
self.assertEqual(mock_proc.mock_calls, [
unittest.mock.call(['qrexec-client-vm', 'test-vm',
'admin.Events'], stdin=subprocess.PIPE,
unittest.mock.call('qrexec-client-vm', 'test-vm',
'admin.Events', stdin=subprocess.PIPE,
stdout=subprocess.PIPE),
unittest.mock.call().stdin.write_eof()
])
Expand Down

0 comments on commit ce7d486

Please sign in to comment.