Skip to content

Commit

Permalink
Don't check whether yaml responses are well-formed
Browse files Browse the repository at this point in the history
pyyaml is unable to parse complex dictionary keys: say, a list or a
dictionary. See yaml/pyyaml#88

Tarantool however supports this kind of output:

 | tarantool> {[{k = 'v'}] = 1}
 | ---
 | - ? k: v
 |   : 1
 | ...

When such response is arrived to test-run, pyyaml raises 'found
unhashable key' exception and test-run reports it as '[Lost current
connection]'.

Let's consider 'core = tarantool' tests. There is no much need to verify
whether a tarantool answer is well-formed yaml document, because it
anyway will be verified against a result file. And also it is unable to
handle the case above. So the check is removed.

See tarantool/tarantool#4421
  • Loading branch information
Totktonada committed Aug 11, 2019
1 parent 947c65c commit e22daf9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/admin_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import re
import sys

import yaml

from tarantool_connection import TarantoolConnection
from tarantool_connection import TarantoolPool
from tarantool_connection import TarantoolAsyncConnection
Expand Down Expand Up @@ -75,11 +73,8 @@ def cmd(self, socket, cmd, silent):
if (res.rfind("\n...\n") >= 0 or res.rfind("\r\n...\r\n") >= 0):
break

try:
yaml.safe_load(res)
finally:
if not silent:
sys.stdout.write(res.replace("\r\n", "\n"))
if not silent:
sys.stdout.write(res.replace("\r\n", "\n"))
return res


Expand Down

0 comments on commit e22daf9

Please sign in to comment.