Revision 64c65a2a
b/lib/cli.py | ||
---|---|---|
198 | 198 |
help="Grab locks while doing the queries" |
199 | 199 |
" in order to ensure more consistent results") |
200 | 200 |
|
201 |
_DRY_RUN_OPT = make_option("--dry-run", default=False, |
|
202 |
action="store_true", |
|
203 |
help="Do not execute the operation, just run the" |
|
204 |
" check steps and verify it it could be executed") |
|
205 |
|
|
201 | 206 |
|
202 | 207 |
def ARGS_FIXED(val): |
203 | 208 |
"""Macro-like function denoting a fixed number of arguments""" |
... | ... | |
380 | 385 |
cmd = aliases[cmd] |
381 | 386 |
|
382 | 387 |
func, nargs, parser_opts, usage, description = commands[cmd] |
383 |
parser = OptionParser(option_list=parser_opts, |
|
388 |
parser = OptionParser(option_list=parser_opts + [_DRY_RUN_OPT],
|
|
384 | 389 |
description=description, |
385 | 390 |
formatter=TitledHelpFormatter(), |
386 | 391 |
usage="%%prog %s %s" % (cmd, usage)) |
... | ... | |
605 | 610 |
whether to just send the job and print its identifier. It is used in |
606 | 611 |
order to simplify the implementation of the '--submit' option. |
607 | 612 |
|
613 |
It will also add the dry-run parameter from the options passed, if true. |
|
614 |
|
|
608 | 615 |
""" |
616 |
if opts and opts.dry_run: |
|
617 |
op.dry_run = opts.dry_run |
|
609 | 618 |
if opts and opts.submit_only: |
610 | 619 |
job_id = SendJob([op], cl=cl) |
611 | 620 |
raise JobSubmittedException(job_id) |
Also available in: Unified diff