Skip to content

Commit

Permalink
Fix #551
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Feb 13, 2018
1 parent 4b3d780 commit 7071346
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions IM/ConfManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(self, inf, auth, max_ctxt_time=1e9):
self.max_ctxt_time = max_ctxt_time
self._stop_thread = False
self.ansible_process = None
self.failed_step = []
self.logger = logging.getLogger('ConfManager')

def check_running_pids(self, vms_configuring, failed_step):
Expand Down Expand Up @@ -190,7 +191,7 @@ def kill_ctxt_processes(self):
def run(self):
self.log_info("Starting the ConfManager Thread")

failed_step = []
self.failed_step = []
last_step = None
vms_configuring = {}

Expand All @@ -207,7 +208,7 @@ def run(self):
self.ansible_process.terminate()
return

failed_step, vms_configuring = self.check_running_pids(vms_configuring, failed_step)
self.failed_step, vms_configuring = self.check_running_pids(vms_configuring, self.failed_step)

# If the queue is empty but there are vms configuring wait and test
# again
Expand All @@ -224,9 +225,9 @@ def run(self):

# if this task is from a next step
if last_step is not None and last_step < step:
if failed_step and sorted(failed_step)[-1] < step:
if self.failed_step and sorted(self.failed_step)[-1] < step:
self.log_info("Configuration of process of step %s failed, "
"ignoring tasks of step %s." % (sorted(failed_step)[-1], step))
"ignoring tasks of step %s." % (sorted(self.failed_step)[-1], step))
else:
# Add the task again to the queue only if the last step was
# OK
Expand Down
2 changes: 2 additions & 0 deletions IM/InfrastructureInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ def Contextualize(self, auth, vm_list=None):
# update the ConfManager auth
self.cm.auth = auth
self.cm.init_time = time.time()
# restart the failed step
self.cm.failed_step = []

def is_authorized(self, auth):
"""
Expand Down

0 comments on commit 7071346

Please sign in to comment.