« Previous | Next » 

Revision 599ee321


Added by Iustin Pop almost 13 years ago

Change handling of non-Ganeti errors in jqueue

Currently, if a job execution raises a Ganeti-specific error (i.e.
subclass of GenericError), then we encode it as (error class, [error
args]). This matches the RAPI documentation.

However, if we get a non-Ganeti error, then we encode it as simply
str(err), a single string. This means that the opresult field is not
according to the RAPI docs, and thus it's hard to reliably parse the
job results.

This patch changes the encoding of a failed job (via failure) to always
be an OpExecError, so that we always encode it properly. For the command
line interface, the behaviour is the same, as any non-Ganeti errors get
re-encoded as OpExecError anyway. For the RAPI clients, it only means
that we always present the same type for results. The actual error value
is the same, since the err.args is either way str(original_error);
compare the original (doesn't contain the ValueError):

"opresult": [
"invalid literal for int(): aa"


"opresult": [
"invalid literal for int(): aa"

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences