Implement reboot command

This commit is contained in:
Ian Gulliver
2016-05-11 00:33:53 +00:00
parent bd320caee8
commit 683252671f

View File

@@ -124,12 +124,18 @@ class Client(threadedclient.WebSocketClient):
FLAGS.boot_dir)
update.Update()
def _OnCommand(self, data):
if data['command'] == 'reboot':
subprocess.check_call(['reboot'])
def received_message(self, msg):
parsed = json.loads(msg.data.decode('utf8'))
if parsed['type'] == 'image_types':
self._OnImageTypes(parsed['data'])
elif parsed['type'] == 'new_manifest':
self._OnNewManifest(parsed['data'])
elif parsed['type'] == 'command':
self._OnCommand(parsed['data'])
def main():