Revision 6340bb0a

b/scripts/gnt-instance
299 299
                                hvm_nic_type=opts.hvm_nic_type,
300 300
                                hvm_disk_type=opts.hvm_disk_type)
301 301

  
302
  SubmitOpCode(op)
302
  SubmitOrSend(op, opts)
303 303
  return 0
304 304

  
305 305

  
......
349 349

  
350 350
  op = opcodes.OpReinstallInstance(instance_name=instance_name,
351 351
                                   os_type=os)
352
  SubmitOpCode(op)
352
  SubmitOrSend(op, opts)
353 353

  
354 354
  return 0
355 355

  
......
374 374

  
375 375
  op = opcodes.OpRemoveInstance(instance_name=instance_name,
376 376
                                ignore_failures=opts.ignore_failures)
377
  SubmitOpCode(op)
377
  SubmitOrSend(op, opts)
378 378
  return 0
379 379

  
380 380

  
......
389 389
  op = opcodes.OpRenameInstance(instance_name=args[0],
390 390
                                new_name=args[1],
391 391
                                ignore_ip=opts.ignore_ip)
392
  SubmitOpCode(op)
393

  
392
  SubmitOrSend(op, opts)
394 393
  return 0
395 394

  
396 395

  
......
405 404
  """
406 405
  instance_name = args[0]
407 406
  op = opcodes.OpActivateInstanceDisks(instance_name=instance_name)
408
  disks_info = SubmitOpCode(op)
407
  disks_info = SubmitOrSend(op, opts)
409 408
  for host, iname, nname in disks_info:
410 409
    print "%s:%s:%s" % (host, iname, nname)
411 410
  return 0
......
420 419
  """
421 420
  instance_name = args[0]
422 421
  op = opcodes.OpDeactivateInstanceDisks(instance_name=instance_name)
423
  SubmitOpCode(op)
422
  SubmitOrSend(op, opts)
424 423
  return 0
425 424

  
426 425

  
......
435 434
  disk = args[1]
436 435
  amount = utils.ParseUnit(args[2])
437 436
  op = opcodes.OpGrowDisk(instance_name=instance, disk=disk, amount=amount)
438
  SubmitOpCode(op)
437
  SubmitOrSend(op, opts)
439 438
  return 0
440 439

  
441 440

  
......
488 487
                                  reboot_type=opts.reboot_type,
489 488
                                  ignore_secondaries=opts.ignore_secondaries)
490 489

  
491
    SubmitOpCode(op)
490
    SubmitOrSend(op, opts)
492 491
  return 0
493 492

  
494 493

  
......
546 545
  op = opcodes.OpReplaceDisks(instance_name=args[0], disks=disks,
547 546
                              remote_node=new_2ndary, mode=mode,
548 547
                              iallocator=iallocator)
549
  SubmitOpCode(op)
548
  SubmitOrSend(op, opts)
550 549
  return 0
551 550

  
552 551

  
......
575 574

  
576 575
  op = opcodes.OpFailoverInstance(instance_name=instance_name,
577 576
                                  ignore_consistency=opts.ignore_consistency)
578
  SubmitOpCode(op)
577
  SubmitOrSend(op, opts)
579 578
  return 0
580 579

  
581 580

  
......
806 805
                                   hvm_disk_type=hvm_disk_type,
807 806
                                   force=opts.force)
808 807

  
809
  result = SubmitOpCode(op)
808
  # even if here we process the result, we allow submit only
809
  result = SubmitOrSend(op, opts)
810 810

  
811 811
  if result:
812 812
    logger.ToStdout("Modified instance %s" % args[0])
......
933 933
  make_option("--vnc-bind-address", dest="vnc_bind_address",
934 934
              help="bind address for VNC (IP address)",
935 935
              default=None, type="string", metavar="<VNCADDRESS>"),
936
  SUBMIT_OPT,
936 937
  ]
937 938

  
938 939
commands = {
......
952 953
                            action="store_true", default=False,
953 954
                            help="Ignore the consistency of the disks on"
954 955
                            " the secondary"),
956
                SUBMIT_OPT,
955 957
                ],
956 958
               "[-f] <instance>",
957 959
               "Stops the instance and starts it on the backup node, using"
......
971 973
                 make_option("--select-os", dest="select_os",
972 974
                             action="store_true", default=False,
973 975
                             help="Interactive OS reinstall, lists available"
974
                             " OS templates for selection")],
976
                             " OS templates for selection"),
977
                 SUBMIT_OPT,
978
                 ],
975 979
                "[-f] <instance>", "Reinstall a stopped instance"),
976 980
  'remove': (RemoveInstance, ARGS_ONE,
977 981
             [DEBUG_OPT, FORCE_OPT,
......
980 984
                          help=("Remove the instance from the cluster even"
981 985
                                " if there are failures during the removal"
982 986
                                " process (shutdown, disk removal, etc.)")),
987
              SUBMIT_OPT,
983 988
              ],
984 989
             "[-f] <instance>", "Shuts down the instance and removes it"),
985 990
  'rename': (RenameInstance, ARGS_FIXED(2),
......
988 993
                          help="Do not check that the IP of the new name"
989 994
                          " is alive",
990 995
                          default=False, action="store_true"),
996
              SUBMIT_OPT,
991 997
              ],
992 998
             "<instance> <new_name>", "Rename the instance"),
993 999
  'replace-disks': (ReplaceDisks, ARGS_ONE,
......
1013 1019
                                 " <NAME> iallocator plugin (enables"
1014 1020
                                 " secondary node replacement)",
1015 1021
                                 default=None, type="string"),
1022
                     SUBMIT_OPT,
1016 1023
                     ],
1017 1024
                    "[-s|-p|-n NODE] <instance>",
1018 1025
                    "Replaces all disks for the instance"),
......
1075 1082
              make_option("--vnc-bind-address", dest="vnc_bind_address",
1076 1083
                          help="bind address for VNC (IP address)",
1077 1084
                          default=None, type="string", metavar="<VNCADDRESS>"),
1085
              SUBMIT_OPT,
1078 1086
              ],
1079 1087
             "<instance>", "Alters the parameters of an instance"),
1080 1088
  'shutdown': (ShutdownInstance, ARGS_ANY,
1081 1089
               [DEBUG_OPT, m_node_opt, m_pri_node_opt, m_sec_node_opt,
1082
                m_clust_opt, m_inst_opt, m_force_multi],
1090
                m_clust_opt, m_inst_opt, m_force_multi,
1091
                SUBMIT_OPT,
1092
                ],
1083 1093
               "<instance>", "Stops an instance"),
1084 1094
  'startup': (StartupInstance, ARGS_ANY,
1085 1095
              [DEBUG_OPT, FORCE_OPT, m_force_multi,
......
1088 1098
                           default=None, type="string", metavar="<PARAMS>"),
1089 1099
               m_node_opt, m_pri_node_opt, m_sec_node_opt,
1090 1100
               m_clust_opt, m_inst_opt,
1101
               SUBMIT_OPT,
1091 1102
               ],
1092 1103
            "<instance>", "Starts an instance"),
1093 1104

  
......
1105 1116
                           help="Ignore errors from secondaries"),
1106 1117
               m_node_opt, m_pri_node_opt, m_sec_node_opt,
1107 1118
               m_clust_opt, m_inst_opt,
1119
               SUBMIT_OPT,
1108 1120
               ],
1109 1121
            "<instance>", "Reboots an instance"),
1110
  'activate-disks': (ActivateDisks, ARGS_ONE, [DEBUG_OPT],
1122
  'activate-disks': (ActivateDisks, ARGS_ONE, [DEBUG_OPT, SUBMIT_OPT],
1111 1123
                     "<instance>",
1112 1124
                     "Activate an instance's disks"),
1113
  'deactivate-disks': (DeactivateDisks, ARGS_ONE, [DEBUG_OPT],
1125
  'deactivate-disks': (DeactivateDisks, ARGS_ONE, [DEBUG_OPT, SUBMIT_OPT],
1114 1126
                       "<instance>",
1115 1127
                       "Deactivate an instance's disks"),
1116
  'grow-disk': (GrowDisk, ARGS_FIXED(3), [DEBUG_OPT],
1128
  'grow-disk': (GrowDisk, ARGS_FIXED(3), [DEBUG_OPT, SUBMIT_OPT],
1117 1129
                "<instance> <disk> <size>", "Grow an instance's disk"),
1118 1130
  'list-tags': (ListTags, ARGS_ONE, [DEBUG_OPT],
1119 1131
                "<node_name>", "List the tags of the given instance"),

Also available in: Unified diff