On Mon, Jun 14, 2010 at 02:49:56PM +0200, Manuel Franceschini wrote:
> 
> Signed-off-by: Manuel Franceschini <[email protected]>
> ---
>  scripts/gnt-debug |    8 +++-----
>  1 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/gnt-debug b/scripts/gnt-debug
> index c96deca..17d80cc 100755
> --- a/scripts/gnt-debug
> +++ b/scripts/gnt-debug
> @@ -59,12 +59,9 @@ def Delay(opts, args):
>  def GenericOpCodes(opts, args):
>    """Send any opcode to the master.
>  
> -  @todo: The function is broken and needs to be converted to the
> -      current job queue API
>    @param opts: the command line options selected by the user
>    @type args: list
> -  @param args: should contain only one element, the path of
> -      the file with the opcode definition
> +  @param args: should contain path to file with job definition only
>    @rtype: int
>    @return: the desired exit code
>  
> @@ -80,7 +77,8 @@ def GenericOpCodes(opts, args):
>      for fname in args:
>        # pylint: disable-msg=W0142
>        op_data = simplejson.loads(utils.ReadFile(fname))
> -      op_list = [opcodes.OpCode.LoadOpCode(val) for val in op_data]
> +      op_list = [opcodes.OpCode.LoadOpCode(val["input"])
> +                 for val in op_data["ops"]]

NACK, this is wrong. You probably copied a serialized opcode from
/var/lib/ganeti/queue/…, which is not the expected input format (it's
the serialized for of _QueuedOpCode, not Opcode).

iustin

Reply via email to