mgmt: allow functions to return None if no data is to be returned

Don't force `return ''` everywhere.

QubesOS/qubes-issues#2622
This commit is contained in:
Marek Marczykowski-Górecki 2017-03-17 12:49:28 +01:00
parent 6924ec3b85
commit 2c115bb648
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -117,7 +117,8 @@ class QubesDaemonProtocol(asyncio.Protocol):
def send_response(self, content): def send_response(self, content):
self.send_header(0x30) self.send_header(0x30)
self.transport.write(content.encode('utf-8')) if content is not None:
self.transport.write(content.encode('utf-8'))
def send_event(self, subject, event, **kwargs): def send_event(self, subject, event, **kwargs):
self.send_header(0x31) self.send_header(0x31)