diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2019-05-01 20:12:11 +0200 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2019-05-01 20:12:11 +0200 |
commit | 6b1c83e57869dc2a5f20ed5cdf35c90deb466b61 (patch) | |
tree | d50fa41c3bcb1e28b5b8b003142b315d06d5b225 | |
parent | baa152ac2f5f7d807a529160d7ac28dd7dfa88ec (diff) |
ctl messages are json, not yaml
-rw-r--r-- | pyapd/ctl.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pyapd/ctl.py b/pyapd/ctl.py index 4f5270f..8be523d 100644 --- a/pyapd/ctl.py +++ b/pyapd/ctl.py @@ -1,9 +1,8 @@ import errno import functools +import json import socket -import ruamel.yaml - import tornado.netutil import tornado.ioloop import tornado.iostream @@ -19,7 +18,6 @@ class Commands(): class CtlServer(): def __init__(self, config): - self.yaml = ruamel.yaml.YAML(typ='safe') self.commands = Commands() self.config = config self.ctl_socket = tornado.netutil.bind_unix_socket( @@ -53,7 +51,7 @@ class CtlServer(): print("command result was:", res) async def get_command(self, message): - args = self.yaml.load(message) + args = json.loads(message) cmd = args.pop('command') try: res = getattr(self.commands, cmd)(*args) @@ -61,5 +59,5 @@ class CtlServer(): res = "no such command" except TypeError: res = "syntax error" - # TODO: wrap res in a sensible yaml + # TODO: wrap res in a sensible json return res |