Commit 400ca2f7 authored by Iustin Pop's avatar Iustin Pop
Browse files

Update scripts to pass 'opts' to SubmitOpCode


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 293ba2d8
......@@ -76,7 +76,7 @@ def ExportInstance(opts, args):
shutdown=opts.shutdown,
shutdown_timeout=opts.shutdown_timeout)
fin_resu, dlist = SubmitOpCode(op)
fin_resu, dlist = SubmitOpCode(op, opts=opts)
if not isinstance(dlist, list):
ToStderr("Cannot parse execution results")
return 1
......@@ -119,7 +119,7 @@ def RemoveExport(opts, args):
"""
op = opcodes.OpRemoveExport(instance_name=args[0])
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
return 0
......
......@@ -105,7 +105,7 @@ def InitCluster(opts, args):
modify_ssh_setup=opts.modify_ssh_setup,
)
op = opcodes.OpPostInitCluster()
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
return 0
......@@ -126,7 +126,7 @@ def DestroyCluster(opts, args):
return 1
op = opcodes.OpDestroyCluster()
master = SubmitOpCode(op)
master = SubmitOpCode(op, opts=opts)
# if we reached this, the opcode didn't fail; we can proceed to
# shutdown all the daemons
bootstrap.FinalizeClusterDestroy(master)
......@@ -153,7 +153,7 @@ def RenameCluster(opts, args):
return 1
op = opcodes.OpRenameCluster(name=name)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
return 0
......@@ -357,7 +357,7 @@ def VerifyCluster(opts, args):
verbose=opts.verbose,
error_codes=opts.error_codes,
debug_simulate_errors=opts.simulate_errors)
if SubmitOpCode(op):
if SubmitOpCode(op, opts=opts):
return 0
else:
return 1
......@@ -374,7 +374,7 @@ def VerifyDisks(opts, args):
"""
op = opcodes.OpVerifyDisks()
result = SubmitOpCode(op)
result = SubmitOpCode(op, opts=opts)
if not isinstance(result, (list, tuple)) or len(result) != 3:
raise errors.ProgrammerError("Unknown result type for OpVerifyDisks")
......@@ -396,7 +396,7 @@ def VerifyDisks(opts, args):
op = opcodes.OpActivateInstanceDisks(instance_name=iname)
try:
ToStdout("Activating disks for instance '%s'", iname)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
except errors.GenericError, err:
nret, msg = FormatError(err)
retcode |= nret
......@@ -434,7 +434,7 @@ def RepairDiskSizes(opts, args):
"""
op = opcodes.OpRepairDiskSizes(instances=args)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
@UsesRPC
......@@ -474,7 +474,7 @@ def SearchTags(opts, args):
"""
op = opcodes.OpSearchTags(pattern=args[0])
result = SubmitOpCode(op)
result = SubmitOpCode(op, opts=opts)
if not result:
return 1
result = list(result)
......@@ -528,7 +528,7 @@ def SetClusterParams(opts, args):
beparams=beparams,
nicparams=nicparams,
candidate_pool_size=opts.candidate_pool_size)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
return 0
......
......@@ -51,7 +51,7 @@ def Delay(opts, args):
op = opcodes.OpTestDelay(duration=delay,
on_master=opts.on_master,
on_nodes=opts.on_nodes)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
return 0
......@@ -150,7 +150,7 @@ def TestAllocator(opts, args):
direction=opts.direction,
allocator=opts.iallocator,
)
result = SubmitOpCode(op)
result = SubmitOpCode(op, opts=opts)
ToStdout("%s" % result)
return 0
......
......@@ -517,7 +517,7 @@ def ReinstallInstance(opts, args):
if opts.select_os is True:
op = opcodes.OpDiagnoseOS(output_fields=["name", "valid", "variants"],
names=[])
result = SubmitOpCode(op)
result = SubmitOpCode(op, opts=opts)
if not result:
ToStdout("Can't get the OS list")
......@@ -880,7 +880,7 @@ def MigrateInstance(opts, args):
op = opcodes.OpMigrateInstance(instance_name=instance_name, live=opts.live,
cleanup=opts.cleanup)
SubmitOpCode(op, cl=cl)
SubmitOpCode(op, cl=cl, opts=opts)
return 0
......@@ -925,7 +925,7 @@ def ConnectToInstanceConsole(opts, args):
instance_name = args[0]
op = opcodes.OpConnectConsole(instance_name=instance_name)
cmd = SubmitOpCode(op)
cmd = SubmitOpCode(op, opts=opts)
if opts.show_command:
ToStdout("%s", utils.ShellQuoteArgs(cmd))
......@@ -1123,7 +1123,7 @@ def ShowInstanceConfig(opts, args):
retcode = 0
op = opcodes.OpQueryInstanceData(instances=args, static=opts.static)
result = SubmitOpCode(op)
result = SubmitOpCode(op, opts=opts)
if not result:
ToStdout("No instances.")
return 1
......
......@@ -173,7 +173,7 @@ def AddNode(opts, args):
op = opcodes.OpAddNode(node_name=args[0], secondary_ip=sip,
readd=opts.readd)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
def ListNodes(opts, args):
......@@ -289,7 +289,7 @@ def EvacuateNode(opts, args):
op = opcodes.OpEvacuateNode(node_name=args[0], remote_node=dst_node,
iallocator=iallocator)
SubmitOpCode(op, cl=cl)
SubmitOpCode(op, cl=cl, opts=opts)
def FailoverNode(opts, args):
......@@ -361,7 +361,7 @@ def MigrateNode(opts, args):
return 2
op = opcodes.OpMigrateNode(node_name=args[0], live=opts.live)
SubmitOpCode(op, cl=cl)
SubmitOpCode(op, cl=cl, opts=opts)
def ShowNodeConfig(opts, args):
......@@ -418,7 +418,7 @@ def RemoveNode(opts, args):
"""
op = opcodes.OpRemoveNode(node_name=args[0])
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
return 0
......@@ -439,7 +439,7 @@ def PowercycleNode(opts, args):
return 2
op = opcodes.OpPowercycleNode(node_name=node, force=opts.force)
result = SubmitOpCode(op)
result = SubmitOpCode(op, opts=opts)
ToStderr(result)
return 0
......@@ -463,7 +463,7 @@ def ListVolumes(opts, args):
selected_fields = opts.output.split(",")
op = opcodes.OpQueryNodeVolumes(nodes=args, output_fields=selected_fields)
output = SubmitOpCode(op)
output = SubmitOpCode(op, opts=opts)
if not opts.no_headers:
headers = {"node": "Node", "phys": "PhysDev",
......@@ -514,7 +514,7 @@ def ListStorage(opts, args):
op = opcodes.OpQueryNodeStorage(nodes=args,
storage_type=storage_type,
output_fields=selected_fields)
output = SubmitOpCode(op)
output = SubmitOpCode(op, opts=opts)
if not opts.no_headers:
headers = {
......@@ -577,7 +577,7 @@ def ModifyStorage(opts, args):
storage_type=storage_type,
name=volume_name,
changes=changes)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
else:
ToStderr("No changes to perform, exiting.")
......@@ -600,7 +600,7 @@ def RepairStorage(opts, args):
storage_type=storage_type,
name=volume_name,
ignore_consistency=opts.ignore_consistency)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
def SetNodeParams(opts, args):
......
......@@ -45,7 +45,7 @@ def ListOS(opts, args):
"""
op = opcodes.OpDiagnoseOS(output_fields=["name", "valid", "variants"],
names=[])
result = SubmitOpCode(op)
result = SubmitOpCode(op, opts=opts)
if not result:
ToStderr("Can't get the OS list")
......@@ -98,7 +98,7 @@ def DiagnoseOS(opts, args):
"""
op = opcodes.OpDiagnoseOS(output_fields=["name", "valid", "variants",
"node_status"], names=[])
result = SubmitOpCode(op)
result = SubmitOpCode(op, opts=opts)
if not result:
ToStderr("Can't get the OS list")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment