Revision 2f79bd34 scripts/gnt-instance
b/scripts/gnt-instance | ||
---|---|---|
19 | 19 |
# 02110-1301, USA. |
20 | 20 |
|
21 | 21 |
|
22 |
# pylint: disable-msg=W0401,W0614 |
|
23 |
# W0401: Wildcard import ganeti.cli |
|
24 |
# W0614: Unused import %s from wildcard import (since we need cli) |
|
25 |
|
|
22 | 26 |
import sys |
23 | 27 |
import os |
24 | 28 |
import itertools |
... | ... | |
353 | 357 |
|
354 | 358 |
def _PopulateWithDefaults(spec): |
355 | 359 |
"""Returns a new hash combined with default values.""" |
356 |
dict = _DEFAULT_SPECS.copy() |
|
357 |
dict.update(spec) |
|
358 |
return dict |
|
360 |
mydict = _DEFAULT_SPECS.copy()
|
|
361 |
mydict.update(spec)
|
|
362 |
return mydict
|
|
359 | 363 |
|
360 | 364 |
def _Validate(spec): |
361 | 365 |
"""Validate the instance specs.""" |
... | ... | |
456 | 460 |
ToStdout("User aborted reinstall, exiting") |
457 | 461 |
return 1 |
458 | 462 |
|
459 |
os = selected |
|
463 |
os_name = selected
|
|
460 | 464 |
else: |
461 |
os = opts.os |
|
465 |
os_name = opts.os
|
|
462 | 466 |
|
463 | 467 |
if not opts.force: |
464 | 468 |
usertext = ("This will reinstall the instance %s and remove" |
... | ... | |
467 | 471 |
return 1 |
468 | 472 |
|
469 | 473 |
op = opcodes.OpReinstallInstance(instance_name=instance_name, |
470 |
os_type=os) |
|
474 |
os_type=os_name)
|
|
471 | 475 |
SubmitOrSend(op, opts) |
472 | 476 |
|
473 | 477 |
return 0 |
... | ... | |
726 | 730 |
os.execvp(cmd[0], cmd) |
727 | 731 |
finally: |
728 | 732 |
ToStderr("Can't run console command %s with arguments:\n'%s'", |
729 |
cmd, " ".join(argv))
|
|
733 |
cmd[0], " ".join(cmd))
|
|
730 | 734 |
os._exit(1) |
731 | 735 |
|
732 | 736 |
|
Also available in: Unified diff