Commit cb573a31 authored by Iustin Pop's avatar Iustin Pop
Browse files

Convert scripts to pass options to the JobExecutor


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent cff5fa7f
......@@ -70,7 +70,7 @@ def GenericOpCodes(opts, args):
"""
cl = cli.GetClient()
jex = cli.JobExecutor(cl=cl, verbose=opts.verbose)
jex = cli.JobExecutor(cl=cl, verbose=opts.verbose, opts=opts)
job_cnt = 0
op_cnt = 0
......
......@@ -222,7 +222,7 @@ def GenericManyOps(operation, fn):
if not (opts.force_multi or not multi_on
or _ConfirmOperation(inames, operation)):
return 1
jex = JobExecutor(verbose=multi_on, cl=cl)
jex = JobExecutor(verbose=multi_on, cl=cl, opts=opts)
for name in inames:
op = fn(name, opts)
jex.QueueJob(name, op)
......@@ -423,7 +423,7 @@ def BatchCreate(opts, args):
ToStderr("Can't parse the instance definition file: %s" % str(err))
return 1
jex = JobExecutor()
jex = JobExecutor(opts=opts)
# Iterate over the instances and do:
# * Populate the specs with default value
......@@ -560,7 +560,7 @@ def ReinstallInstance(opts, args):
if not AskUser(usertext):
return 1
jex = JobExecutor(verbose=multi_on)
jex = JobExecutor(verbose=multi_on, opts=opts)
for instance_name in inames:
op = opcodes.OpReinstallInstance(instance_name=instance_name,
os_type=os_name,
......
......@@ -324,7 +324,7 @@ def FailoverNode(opts, args):
(",".join("'%s'" % name for name in pinst))):
return 2
jex = JobExecutor(cl=cl)
jex = JobExecutor(cl=cl, opts=opts)
for iname in pinst:
op = opcodes.OpFailoverInstance(instance_name=iname,
ignore_consistency=opts.ignore_consistency)
......
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