Revision 400ca2f7
b/scripts/gnt-backup | ||
---|---|---|
76 | 76 |
shutdown=opts.shutdown, |
77 | 77 |
shutdown_timeout=opts.shutdown_timeout) |
78 | 78 |
|
79 |
fin_resu, dlist = SubmitOpCode(op) |
|
79 |
fin_resu, dlist = SubmitOpCode(op, opts=opts)
|
|
80 | 80 |
if not isinstance(dlist, list): |
81 | 81 |
ToStderr("Cannot parse execution results") |
82 | 82 |
return 1 |
... | ... | |
119 | 119 |
""" |
120 | 120 |
op = opcodes.OpRemoveExport(instance_name=args[0]) |
121 | 121 |
|
122 |
SubmitOpCode(op) |
|
122 |
SubmitOpCode(op, opts=opts)
|
|
123 | 123 |
return 0 |
124 | 124 |
|
125 | 125 |
|
b/scripts/gnt-cluster | ||
---|---|---|
105 | 105 |
modify_ssh_setup=opts.modify_ssh_setup, |
106 | 106 |
) |
107 | 107 |
op = opcodes.OpPostInitCluster() |
108 |
SubmitOpCode(op) |
|
108 |
SubmitOpCode(op, opts=opts)
|
|
109 | 109 |
return 0 |
110 | 110 |
|
111 | 111 |
|
... | ... | |
126 | 126 |
return 1 |
127 | 127 |
|
128 | 128 |
op = opcodes.OpDestroyCluster() |
129 |
master = SubmitOpCode(op) |
|
129 |
master = SubmitOpCode(op, opts=opts)
|
|
130 | 130 |
# if we reached this, the opcode didn't fail; we can proceed to |
131 | 131 |
# shutdown all the daemons |
132 | 132 |
bootstrap.FinalizeClusterDestroy(master) |
... | ... | |
153 | 153 |
return 1 |
154 | 154 |
|
155 | 155 |
op = opcodes.OpRenameCluster(name=name) |
156 |
SubmitOpCode(op) |
|
156 |
SubmitOpCode(op, opts=opts)
|
|
157 | 157 |
return 0 |
158 | 158 |
|
159 | 159 |
|
... | ... | |
357 | 357 |
verbose=opts.verbose, |
358 | 358 |
error_codes=opts.error_codes, |
359 | 359 |
debug_simulate_errors=opts.simulate_errors) |
360 |
if SubmitOpCode(op): |
|
360 |
if SubmitOpCode(op, opts=opts):
|
|
361 | 361 |
return 0 |
362 | 362 |
else: |
363 | 363 |
return 1 |
... | ... | |
374 | 374 |
|
375 | 375 |
""" |
376 | 376 |
op = opcodes.OpVerifyDisks() |
377 |
result = SubmitOpCode(op) |
|
377 |
result = SubmitOpCode(op, opts=opts)
|
|
378 | 378 |
if not isinstance(result, (list, tuple)) or len(result) != 3: |
379 | 379 |
raise errors.ProgrammerError("Unknown result type for OpVerifyDisks") |
380 | 380 |
|
... | ... | |
396 | 396 |
op = opcodes.OpActivateInstanceDisks(instance_name=iname) |
397 | 397 |
try: |
398 | 398 |
ToStdout("Activating disks for instance '%s'", iname) |
399 |
SubmitOpCode(op) |
|
399 |
SubmitOpCode(op, opts=opts)
|
|
400 | 400 |
except errors.GenericError, err: |
401 | 401 |
nret, msg = FormatError(err) |
402 | 402 |
retcode |= nret |
... | ... | |
434 | 434 |
|
435 | 435 |
""" |
436 | 436 |
op = opcodes.OpRepairDiskSizes(instances=args) |
437 |
SubmitOpCode(op) |
|
437 |
SubmitOpCode(op, opts=opts)
|
|
438 | 438 |
|
439 | 439 |
|
440 | 440 |
@UsesRPC |
... | ... | |
474 | 474 |
|
475 | 475 |
""" |
476 | 476 |
op = opcodes.OpSearchTags(pattern=args[0]) |
477 |
result = SubmitOpCode(op) |
|
477 |
result = SubmitOpCode(op, opts=opts)
|
|
478 | 478 |
if not result: |
479 | 479 |
return 1 |
480 | 480 |
result = list(result) |
... | ... | |
528 | 528 |
beparams=beparams, |
529 | 529 |
nicparams=nicparams, |
530 | 530 |
candidate_pool_size=opts.candidate_pool_size) |
531 |
SubmitOpCode(op) |
|
531 |
SubmitOpCode(op, opts=opts)
|
|
532 | 532 |
return 0 |
533 | 533 |
|
534 | 534 |
|
b/scripts/gnt-debug | ||
---|---|---|
51 | 51 |
op = opcodes.OpTestDelay(duration=delay, |
52 | 52 |
on_master=opts.on_master, |
53 | 53 |
on_nodes=opts.on_nodes) |
54 |
SubmitOpCode(op) |
|
54 |
SubmitOpCode(op, opts=opts)
|
|
55 | 55 |
|
56 | 56 |
return 0 |
57 | 57 |
|
... | ... | |
150 | 150 |
direction=opts.direction, |
151 | 151 |
allocator=opts.iallocator, |
152 | 152 |
) |
153 |
result = SubmitOpCode(op) |
|
153 |
result = SubmitOpCode(op, opts=opts)
|
|
154 | 154 |
ToStdout("%s" % result) |
155 | 155 |
return 0 |
156 | 156 |
|
b/scripts/gnt-instance | ||
---|---|---|
517 | 517 |
if opts.select_os is True: |
518 | 518 |
op = opcodes.OpDiagnoseOS(output_fields=["name", "valid", "variants"], |
519 | 519 |
names=[]) |
520 |
result = SubmitOpCode(op) |
|
520 |
result = SubmitOpCode(op, opts=opts)
|
|
521 | 521 |
|
522 | 522 |
if not result: |
523 | 523 |
ToStdout("Can't get the OS list") |
... | ... | |
880 | 880 |
|
881 | 881 |
op = opcodes.OpMigrateInstance(instance_name=instance_name, live=opts.live, |
882 | 882 |
cleanup=opts.cleanup) |
883 |
SubmitOpCode(op, cl=cl) |
|
883 |
SubmitOpCode(op, cl=cl, opts=opts)
|
|
884 | 884 |
return 0 |
885 | 885 |
|
886 | 886 |
|
... | ... | |
925 | 925 |
instance_name = args[0] |
926 | 926 |
|
927 | 927 |
op = opcodes.OpConnectConsole(instance_name=instance_name) |
928 |
cmd = SubmitOpCode(op) |
|
928 |
cmd = SubmitOpCode(op, opts=opts)
|
|
929 | 929 |
|
930 | 930 |
if opts.show_command: |
931 | 931 |
ToStdout("%s", utils.ShellQuoteArgs(cmd)) |
... | ... | |
1123 | 1123 |
|
1124 | 1124 |
retcode = 0 |
1125 | 1125 |
op = opcodes.OpQueryInstanceData(instances=args, static=opts.static) |
1126 |
result = SubmitOpCode(op) |
|
1126 |
result = SubmitOpCode(op, opts=opts)
|
|
1127 | 1127 |
if not result: |
1128 | 1128 |
ToStdout("No instances.") |
1129 | 1129 |
return 1 |
b/scripts/gnt-node | ||
---|---|---|
173 | 173 |
|
174 | 174 |
op = opcodes.OpAddNode(node_name=args[0], secondary_ip=sip, |
175 | 175 |
readd=opts.readd) |
176 |
SubmitOpCode(op) |
|
176 |
SubmitOpCode(op, opts=opts)
|
|
177 | 177 |
|
178 | 178 |
|
179 | 179 |
def ListNodes(opts, args): |
... | ... | |
289 | 289 |
|
290 | 290 |
op = opcodes.OpEvacuateNode(node_name=args[0], remote_node=dst_node, |
291 | 291 |
iallocator=iallocator) |
292 |
SubmitOpCode(op, cl=cl) |
|
292 |
SubmitOpCode(op, cl=cl, opts=opts)
|
|
293 | 293 |
|
294 | 294 |
|
295 | 295 |
def FailoverNode(opts, args): |
... | ... | |
361 | 361 |
return 2 |
362 | 362 |
|
363 | 363 |
op = opcodes.OpMigrateNode(node_name=args[0], live=opts.live) |
364 |
SubmitOpCode(op, cl=cl) |
|
364 |
SubmitOpCode(op, cl=cl, opts=opts)
|
|
365 | 365 |
|
366 | 366 |
|
367 | 367 |
def ShowNodeConfig(opts, args): |
... | ... | |
418 | 418 |
|
419 | 419 |
""" |
420 | 420 |
op = opcodes.OpRemoveNode(node_name=args[0]) |
421 |
SubmitOpCode(op) |
|
421 |
SubmitOpCode(op, opts=opts)
|
|
422 | 422 |
return 0 |
423 | 423 |
|
424 | 424 |
|
... | ... | |
439 | 439 |
return 2 |
440 | 440 |
|
441 | 441 |
op = opcodes.OpPowercycleNode(node_name=node, force=opts.force) |
442 |
result = SubmitOpCode(op) |
|
442 |
result = SubmitOpCode(op, opts=opts)
|
|
443 | 443 |
ToStderr(result) |
444 | 444 |
return 0 |
445 | 445 |
|
... | ... | |
463 | 463 |
selected_fields = opts.output.split(",") |
464 | 464 |
|
465 | 465 |
op = opcodes.OpQueryNodeVolumes(nodes=args, output_fields=selected_fields) |
466 |
output = SubmitOpCode(op) |
|
466 |
output = SubmitOpCode(op, opts=opts)
|
|
467 | 467 |
|
468 | 468 |
if not opts.no_headers: |
469 | 469 |
headers = {"node": "Node", "phys": "PhysDev", |
... | ... | |
514 | 514 |
op = opcodes.OpQueryNodeStorage(nodes=args, |
515 | 515 |
storage_type=storage_type, |
516 | 516 |
output_fields=selected_fields) |
517 |
output = SubmitOpCode(op) |
|
517 |
output = SubmitOpCode(op, opts=opts)
|
|
518 | 518 |
|
519 | 519 |
if not opts.no_headers: |
520 | 520 |
headers = { |
... | ... | |
577 | 577 |
storage_type=storage_type, |
578 | 578 |
name=volume_name, |
579 | 579 |
changes=changes) |
580 |
SubmitOpCode(op) |
|
580 |
SubmitOpCode(op, opts=opts)
|
|
581 | 581 |
else: |
582 | 582 |
ToStderr("No changes to perform, exiting.") |
583 | 583 |
|
... | ... | |
600 | 600 |
storage_type=storage_type, |
601 | 601 |
name=volume_name, |
602 | 602 |
ignore_consistency=opts.ignore_consistency) |
603 |
SubmitOpCode(op) |
|
603 |
SubmitOpCode(op, opts=opts)
|
|
604 | 604 |
|
605 | 605 |
|
606 | 606 |
def SetNodeParams(opts, args): |
b/scripts/gnt-os | ||
---|---|---|
45 | 45 |
""" |
46 | 46 |
op = opcodes.OpDiagnoseOS(output_fields=["name", "valid", "variants"], |
47 | 47 |
names=[]) |
48 |
result = SubmitOpCode(op) |
|
48 |
result = SubmitOpCode(op, opts=opts)
|
|
49 | 49 |
|
50 | 50 |
if not result: |
51 | 51 |
ToStderr("Can't get the OS list") |
... | ... | |
98 | 98 |
""" |
99 | 99 |
op = opcodes.OpDiagnoseOS(output_fields=["name", "valid", "variants", |
100 | 100 |
"node_status"], names=[]) |
101 |
result = SubmitOpCode(op) |
|
101 |
result = SubmitOpCode(op, opts=opts)
|
|
102 | 102 |
|
103 | 103 |
if not result: |
104 | 104 |
ToStderr("Can't get the OS list") |
Also available in: Unified diff