Browse Source

events: fix calling mgmt.Events from VM

asyncio.create_subprocess_exec expects program and arguments directly,
not as a list.
Marek Marczykowski-Górecki 7 years ago
parent
commit
ce7d4865b6
2 changed files with 5 additions and 5 deletions
  1. 1 1
      qubesadmin/events/__init__.py
  2. 4 4
      qubesadmin/tests/events.py

+ 1 - 1
qubesadmin/events/__init__.py

@@ -87,7 +87,7 @@ class EventsDispatcher(object):
                 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()

+ 4 - 4
qubesadmin/tests/events.py

@@ -199,8 +199,8 @@ class TC_00_Events(qubesadmin.tests.QubesTestCase):
             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()
             ])
@@ -224,8 +224,8 @@ class TC_00_Events(qubesadmin.tests.QubesTestCase):
             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()
             ])