Fixed "'NoneType' object has no attribute 'terminate_instances'" error, which might occur if the "verify_regnode" method (nodeup.py) timeouts
@@ -631,6 +631,7 @@ def verify_regnode(ec2, ins_id, num_rep, time_rep, run_id, api):
break
rep = increment_or_fail(num_rep, rep,
'Exceeded retry count ({}) for instance (ID: {}, NodeName: {}) cluster registration'.format(num_rep, ins_id, nodename),
+ ec2_client=ec2,
kill_instance_id_on_fail=ins_id)
sleep(time_rep)
@@ -645,6 +646,7 @@ def verify_regnode(ec2, ins_id, num_rep, time_rep, run_id, api):
break
rep = increment_or_fail(num_rep, rep,
'Exceeded retry count ({}) for instance (ID: {}, NodeName: {}) kube node READY check'.format(num_rep, ins_id, ret_namenode),
+ ec2_client=ec2,
kill_instance_id_on_fail=ins_id)
sleep(time_rep)
@@ -660,6 +662,7 @@ def verify_regnode(ec2, ins_id, num_rep, time_rep, run_id, api):
pipe_log('- {} of {} agents initialized. Still waiting...'.format(ready_pods, count_pods))
rep = increment_or_fail(num_rep, rep,
'Exceeded retry count ({}) for instance (ID: {}, NodeName: {}) kube system pods check'.format(num_rep, ins_id, ret_namenode),
+ ec2_client=ec2,
kill_instance_id_on_fail=ins_id)
sleep(time_rep)
pipe_log('Instance {} successfully registred in cluster with name {}\n-'.format(ins_id, nodename))
