Add reset of admin node after hang

The first hang can be fixed with reset.
If any other errors appear on that stage,
the error should not be tolerated.

Change-Id: I056879a89cb3cfab45852573730f0ced58043511
Closes-bug: 1587411
This commit is contained in:
Alexandr Kostrikov 2016-10-25 18:44:01 +03:00
parent ebdeaf272f
commit 4f486061a9

View File

@ -413,18 +413,29 @@ class EnvironmentModel(six.with_metaclass(SingletonMeta, object)):
admin = self.d_env.nodes().admin
self.d_env.start([admin])
logger.info("Waiting for admin node to start up")
wait(lambda: admin.driver.node_active(admin), 60,
timeout_msg='Admin node startup timeout')
logger.info("Proceed with installation")
# update network parameters at boot screen
admin.send_keys(self.get_keys(admin, custom=custom,
build_images=build_images,
iso_connect_as=iso_connect_as))
if settings.SHOW_FUELMENU:
self.wait_for_fuelmenu()
else:
self.wait_for_provisioning()
def provision_admin(admin_node):
logger.info("Waiting for admin node to start up")
wait(lambda: admin.driver.node_active(admin_node), 60,
timeout_msg='Admin node startup timeout')
logger.info("Proceed with installation")
# update network parameters at boot screen
admin_node.send_keys(self.get_keys(
admin_node,
custom=custom,
build_images=build_images,
iso_connect_as=iso_connect_as))
if settings.SHOW_FUELMENU:
self.wait_for_fuelmenu()
else:
self.wait_for_provisioning()
try:
provision_admin(admin)
except Exception as e:
logger.info('Master node restart: LP1587411')
logger.info('Exception is: {e}'.format(e=e))
admin.reset()
provision_admin(admin)
self.set_admin_ssh_password()