api: use str(subject) instead of explicit subject.name
This allows better flexibility, when subject is not necessary a VM object.
This commit is contained in:
parent
c17e63588e
commit
0d9574d9fc
@ -323,7 +323,7 @@ class QubesDaemonProtocol(asyncio.Protocol):
|
|||||||
self.send_header(0x31)
|
self.send_header(0x31)
|
||||||
|
|
||||||
if subject is not self.app:
|
if subject is not self.app:
|
||||||
self.transport.write(subject.name.encode('ascii'))
|
self.transport.write(str(subject).encode('ascii'))
|
||||||
self.transport.write(b'\0')
|
self.transport.write(b'\0')
|
||||||
|
|
||||||
self.transport.write(event.encode('ascii') + b'\0')
|
self.transport.write(event.encode('ascii') + b'\0')
|
||||||
|
@ -77,7 +77,11 @@ class TestMgmt(object):
|
|||||||
|
|
||||||
class Subject:
|
class Subject:
|
||||||
name = 'subject'
|
name = 'subject'
|
||||||
self.send_event(Subject, 'event', payload=untrusted_payload.decode())
|
|
||||||
|
def __str__(self):
|
||||||
|
return 'subject'
|
||||||
|
|
||||||
|
self.send_event(Subject(), 'event', payload=untrusted_payload.decode())
|
||||||
try:
|
try:
|
||||||
# give some time to close the other end
|
# give some time to close the other end
|
||||||
yield from asyncio.sleep(0.1)
|
yield from asyncio.sleep(0.1)
|
||||||
|
Loading…
Reference in New Issue
Block a user