Fix schema path call and version check

This commit is contained in:
Joshua Boniface 2021-06-13 14:43:37 -04:00
parent 26b1f531e9
commit 680c62a6e4
1 changed files with 2 additions and 2 deletions

View File

@ -318,12 +318,12 @@ def cluster_restore(zkhandler, cluster_data):
kv = [] kv = []
schema_version = None schema_version = None
for key in cluster_data: for key in cluster_data:
if key == zkhandler.zkschema.path('base.schema.version'): if key == zkhandler.schema.path('base.schema.version'):
schema_version = cluster_data[key] schema_version = cluster_data[key]
data = cluster_data[key] data = cluster_data[key]
kv.append((key, data)) kv.append((key, data))
if schema_version != zkhandler.schema.version: if int(schema_version) != int(zkhandler.schema.version):
return False, 'ERROR: Schema version of backup ({}) does not match cluster schema version ({}).'.format(schema_version, zkhandler.schema.version) return False, 'ERROR: Schema version of backup ({}) does not match cluster schema version ({}).'.format(schema_version, zkhandler.schema.version)
# Close the Zookeeper connection # Close the Zookeeper connection