Skip to content
  • Iustin Pop's avatar
    Implement job summary in gnt-job list · 60dd1473
    Iustin Pop authored
    It is not currently possibly to show a summary of the job in the output
    of “gnt-job list”. The closes is listing the whole opcode(s), but that
    is too verbose. Also, the default output (id, status) is not very
    useful, unless one looks for (and knows about) an exact job ID.
    The patch adds a “summary” description of a job composed of the list of
    OP_ID of the individual opcodes. Moreover, if an opcode has a ‘logical’
    target in a certain opcode field (e.g. start instance has the instance
    name as the target), then it is included in the formatting also. It's
    easier to explain via a sample output:
    gnt-job list
    ID Status  Summary
    1  error   NODE_QUERY
    2  success NODE_ADD(gnta2)
    3  success CLUSTER_QUERY
    4  success NODE_REMOVE(
    5  error   NODE_QUERY
    6  success NODE_ADD(gnta2)
    7  success NODE_QUERY
    8  success OS_DIAGNOSE
    9  success INSTANCE_CREATE(
    10 success INSTANCE_REMOVE(
    11 error   INSTANCE_CREATE(
    12 success INSTANCE_CREATE(
    13 success INSTANCE_SHUTDOWN(
    15 error   INSTANCE_CREATE(
    16 error   INSTANCE_CREATE(
    17 success INSTANCE_CREATE(
    20 success INSTANCE_SHUTDOWN(
    21 success INSTANCE_SHUTDOWN(
    This is done by a simple change to the opcode classes, which allows an
    opcode to format itself. The additional function is small enough that it
    can go in, where it could also be used by a client if needed.
    Reviewed-by: imsnah