Revision f4484122 lib/cli.py

b/lib/cli.py
1132 1132
  prev_job_info = None
1133 1133
  prev_logmsg_serial = None
1134 1134

  
1135
  status = None
1136

  
1137
  notified_queued = False
1138
  notified_waitlock = False
1139

  
1135 1140
  while True:
1136
    result = cl.WaitForJobChange(job_id, ["status"], prev_job_info,
1137
                                 prev_logmsg_serial)
1141
    result = cl.WaitForJobChangeOnce(job_id, ["status"], prev_job_info,
1142
                                     prev_logmsg_serial)
1138 1143
    if not result:
1139 1144
      # job not found, go away!
1140 1145
      raise errors.JobLost("Job with id %s lost" % job_id)
1146
    elif result == constants.JOB_NOTCHANGED:
1147
      if status is not None and not callable(feedback_fn):
1148
        if status == constants.JOB_STATUS_QUEUED and not notified_queued:
1149
          ToStderr("Job %s is waiting in queue", job_id)
1150
          notified_queued = True
1151
        elif status == constants.JOB_STATUS_WAITLOCK and not notified_waitlock:
1152
          ToStderr("Job %s is trying to acquire all necessary locks", job_id)
1153
          notified_waitlock = True
1154

  
1155
      # Wait again
1156
      continue
1141 1157

  
1142 1158
    # Split result, a tuple of (field values, log entries)
1143 1159
    (job_info, log_entries) = result

Also available in: Unified diff