Revision f5d13a77

b/lib/client/gnt_job.py
440 440
  return retcode
441 441

  
442 442

  
443
def WaitJob(opts, args):
444
  """Wait for a job to finish, not producing any output.
445

  
446
  @param opts: the command line options selected by the user
447
  @type args: list
448
  @param args: Contains the job ID
449
  @rtype: int
450
  @return: the desired exit code
451

  
452
  """
453
  job_id = args[0]
454

  
455
  retcode = 0
456
  try:
457
    cli.PollJob(job_id, feedback_fn=lambda _: None)
458
  except errors.GenericError, err:
459
    (retcode, job_result) = cli.FormatError(err)
460
    ToStderr("Job %s failed: %s", job_id, job_result)
461

  
462
  return retcode
463

  
464

  
443 465
_PENDING_OPT = \
444 466
  cli_option("--pending", default=None,
445 467
             action="store_const", dest="status_filter",
......
523 545
    ShowJobs, [ArgJobId(min=1)], [],
524 546
    "<job-id> [<job-id> ...]",
525 547
    "Show detailed information about the specified jobs"),
548
  "wait": (
549
    WaitJob, [ArgJobId(min=1, max=1)], [],
550
    "<job-id>", "Wait for a job to finish"),
526 551
  "watch": (
527 552
    WatchJob, [ArgJobId(min=1, max=1)], [],
528 553
    "<job-id>", "Follows a job and prints its output as it arrives"),
b/man/gnt-job.rst
124 124
Lists available fields for jobs.
125 125

  
126 126

  
127
WAIT
128
~~~~~
129

  
130
**wait** {id}
131

  
132
Wait for the job by the given *id* to finish; do not produce
133
any output.
134

  
127 135
WATCH
128 136
~~~~~
129 137

  

Also available in: Unified diff