Revision acd65a16 daemons/import-export
b/daemons/import-export | ||
---|---|---|
40 | 40 |
from ganeti import constants |
41 | 41 |
from ganeti import cli |
42 | 42 |
from ganeti import utils |
43 |
from ganeti import errors |
|
43 | 44 |
from ganeti import serializer |
44 | 45 |
from ganeti import objects |
45 | 46 |
from ganeti import locking |
... | ... | |
401 | 402 |
# Won't return |
402 | 403 |
parser.error("Invalid mode: %s" % mode) |
403 | 404 |
|
405 |
# Normalize and check parameters |
|
406 |
if options.host is not None: |
|
407 |
try: |
|
408 |
options.host = utils.HostInfo.NormalizeName(options.host) |
|
409 |
except errors.OpPrereqError, err: |
|
410 |
parser.error("Invalid hostname '%s': %s" % (options.host, err)) |
|
411 |
|
|
412 |
if options.port is not None: |
|
413 |
options.port = utils.ValidateServiceName(options.port) |
|
414 |
|
|
404 | 415 |
if (options.exp_size is not None and |
405 | 416 |
options.exp_size != constants.IE_CUSTOM_SIZE): |
406 | 417 |
try: |
Also available in: Unified diff