def track_changes(host):
  changes = host.changes().list()
  c = changes[-1]
  current_task = -1
  done = False
  while not done:
    for t in c.tasks:
      # Skip already processed tasks
      if t.order_num < current_task:
        continue

      # If the current task
      if t.order_num == current_task:
        if t.status == "OK":
          print " [OK]"
          if current_task == len(c.tasks) -1:
              done = True
          continue
        elif t.status == "ERROR":
          print " [ERROR](%s...)" % t.error[:80]
          if current_task == len(c.tasks) -1:
              done = True
          continue
        if t.status == "PENDING":
          break
       
      # Moved to a new task
      current_task = t.order_num
      sys.stdout.write(t.description % "  - %s...")
      sys.stdout.flush()
      break

    # Otherwise we wait, refresh, and loop
    time.sleep(1)
    c.refresh()
dataset/ETHPy150Open comodit/demos/openshift/helper.py/track_changes/swapped operands of `%`