events: fix calling mgmt.Events from VM

asyncio.create_subprocess_exec expects program and arguments directly,
not as a list.
This commit is contained in:
Marek Marczykowski-Górecki 2017-06-25 14:01:14 +02:00
parent c545c95660
commit ce7d4865b6
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 5 additions and 5 deletions

View File

@ -87,7 +87,7 @@ class EventsDispatcher(object):
writer.close() writer.close()
elif self.app.qubesd_connection_type == 'qrexec': elif self.app.qubesd_connection_type == 'qrexec':
proc = yield from asyncio.create_subprocess_exec( 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) stdin=subprocess.PIPE, stdout=subprocess.PIPE)
proc.stdin.write_eof() proc.stdin.write_eof()

View File

@ -199,8 +199,8 @@ class TC_00_Events(qubesadmin.tests.QubesTestCase):
task = asyncio.ensure_future(self.dispatcher._get_events_reader()) task = asyncio.ensure_future(self.dispatcher._get_events_reader())
loop.run_until_complete(task) loop.run_until_complete(task)
self.assertEqual(mock_proc.mock_calls, [ self.assertEqual(mock_proc.mock_calls, [
unittest.mock.call(['qrexec-client-vm', 'dom0', unittest.mock.call('qrexec-client-vm', 'dom0',
'admin.Events'], stdin=subprocess.PIPE, 'admin.Events', stdin=subprocess.PIPE,
stdout=subprocess.PIPE), stdout=subprocess.PIPE),
unittest.mock.call().stdin.write_eof() unittest.mock.call().stdin.write_eof()
]) ])
@ -224,8 +224,8 @@ class TC_00_Events(qubesadmin.tests.QubesTestCase):
task = asyncio.ensure_future(self.dispatcher._get_events_reader(vm)) task = asyncio.ensure_future(self.dispatcher._get_events_reader(vm))
loop.run_until_complete(task) loop.run_until_complete(task)
self.assertEqual(mock_proc.mock_calls, [ self.assertEqual(mock_proc.mock_calls, [
unittest.mock.call(['qrexec-client-vm', 'test-vm', unittest.mock.call('qrexec-client-vm', 'test-vm',
'admin.Events'], stdin=subprocess.PIPE, 'admin.Events', stdin=subprocess.PIPE,
stdout=subprocess.PIPE), stdout=subprocess.PIPE),
unittest.mock.call().stdin.write_eof() unittest.mock.call().stdin.write_eof()
]) ])