2009/9/18 Iustin Pop <[email protected]>:
> --- a/scripts/gnt-instance
> +++ b/scripts/gnt-instance
> +def _ManyOpsWrapper(operation):
> +  def wrap(fn):
> +    def realfn(opts, args):
> […]
> +      return 0
> +    return realfn
> +  return wrap

This wrapper changes the result value of the wrapped function and it's
not very obvious. Can you maybe write it a more expressive way?

def _StartInstance(name, opts):
  return opcodes.OpStartupInstance(…)

def GetManyOperations(fn, operation):
  def manyops(…):
    …
    op = fn(…)
    …
    return 0
  return manyops

commands = [(…, GetManyOperations(_StartInstance, "startup"), …)…]

Regards,
Michael

Reply via email to