kvm resiliency test: better handling when takeover fails.

parent fecbf6f4
...@@ -163,16 +163,25 @@ def runTestSuite(server_url, key_file, cert_file, ...@@ -163,16 +163,25 @@ def runTestSuite(server_url, key_file, cert_file,
# Make the clone instance takeover the main instance # Make the clone instance takeover the main instance
logger.info('Replacing main instance by clone instance...') logger.info('Replacing main instance by clone instance...')
takeover( for i in range(0, 10):
server_url=server_url, try:
key_file=key_file, takeover(
cert_file=cert_file, server_url=server_url,
computer_guid=computer_id, key_file=key_file,
partition_id=partition_id, cert_file=cert_file,
software_release=software, computer_guid=computer_id,
namebase=namebase, partition_id=partition_id,
winner_instance_suffix=str(current_clone), software_release=software,
) namebase=namebase,
winner_instance_suffix=str(current_clone),
)
break
except: # SSLError
traceback.print_exc()
if i is 9:
raise
logger.warning('takeover failed. Retrying...')
time.sleep(10)
logger.info('Done.') logger.info('Done.')
# Wait for the new IP (of old-clone new-main instance) to appear. # Wait for the new IP (of old-clone new-main instance) to appear.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment