Add version to replica prepare file, prevent installing to older version

This commit is contained in:
Rob Crittenden
2012-08-29 11:32:03 -04:00
committed by Martin Kosek
parent ac6cc479ed
commit 26dfbe61dd
5 changed files with 21 additions and 7 deletions

View File

@@ -328,6 +328,10 @@ def main():
config = ReplicaConfig()
read_replica_info(dir, config)
root_logger.debug('Installing replica file with version %d (0 means no version in prepared file).' % config.version)
if config.version and config.version > version.NUM_VERSION:
root_logger.error('A replica file from a newer release (%d) cannot be installed on an older version (%d)' % (config.version, version.NUM_VERSION))
sys.exit(1)
config.dirman_password = dirman_password
try:
host = get_host_name(options.no_host_dns)