Skip to content

Commit efcf2c6

Browse files
ligurioTotktonada
andcommitted
lib: replace list with tuple for returned version
Co-authored-by: Alexander Turenko <alexander.turenko@tarantool.org>
1 parent e7356c7 commit efcf2c6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/tarantool_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,8 @@ def start(self, silent=True, wait=True, wait_load=True, rais=True, args=[],
912912
# Verify that the schema actually was not upgraded.
913913
if self.disable_schema_upgrade:
914914
expected_version = extract_schema_from_snapshot(self.snapshot_path)
915-
actual_version = yaml.safe_load(self.admin.execute(
916-
'box.space._schema:get{"version"}'))[0]
915+
actual_version = tuple(yaml.safe_load(self.admin.execute(
916+
'box.space._schema:get{"version"}'))[0][1:])
917917
if expected_version != actual_version:
918918
color_stdout('Schema version check fails: expected '
919919
'{}, got {}\n'.format(expected_version,

lib/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,15 @@ def extract_schema_from_snapshot(snapshot_path):
303303
"BODY": {"space_id": 272, "tuple": ["version", 2, 3, 1]}
304304
}
305305
306-
:returns: [u'version', 2, 3, 1]
306+
:returns: (2, 3, 1)
307307
"""
308308
BOX_SCHEMA_ID = 272
309309
for row in xlog_rows(snapshot_path):
310310
if row['HEADER']['type'] == 'INSERT' and \
311311
row['BODY']['space_id'] == BOX_SCHEMA_ID:
312312
res = row['BODY']['tuple']
313313
if res[0] == 'version':
314-
return res
314+
return tuple(res[1:])
315315
return None
316316

317317

0 commit comments

Comments
 (0)