Revision 1d3dfa29 daemons/import-export
b/daemons/import-export | ||
---|---|---|
384 | 384 |
parser.add_option("--expected-size", dest="exp_size", action="store", |
385 | 385 |
type="string", default=None, |
386 | 386 |
help="Expected import/export size (MiB)") |
387 |
parser.add_option("--magic", dest="magic", action="store", |
|
388 |
type="string", default=None, help="Magic string") |
|
387 | 389 |
parser.add_option("--cmd-prefix", dest="cmd_prefix", action="store", |
388 | 390 |
type="string", help="Command prefix") |
389 | 391 |
parser.add_option("--cmd-suffix", dest="cmd_suffix", action="store", |
... | ... | |
421 | 423 |
parser.error("Invalid value for --expected-size: %s (%s)" % |
422 | 424 |
(options.exp_size, err)) |
423 | 425 |
|
426 |
if not (options.magic is None or constants.IE_MAGIC_RE.match(options.magic)): |
|
427 |
parser.error("Magic must match regular expression %s" % |
|
428 |
constants.IE_MAGIC_RE.pattern) |
|
429 |
|
|
424 | 430 |
return (status_file_path, mode) |
425 | 431 |
|
426 | 432 |
|
Also available in: Unified diff