
from __future__ import absolute_import
from __future__ import division

import libvirt

_TYPE = {
    libvirt.VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN: "UNKNOWN",
    libvirt.VIR_DOMAIN_BLOCK_JOB_TYPE_PULL: "PULL",
    libvirt.VIR_DOMAIN_BLOCK_JOB_TYPE_COPY: "COPY",
    libvirt.VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT: "COMMIT",
    libvirt.VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT: "ACTIVE_COMMIT",
}


def type_name(job_type):
    return _TYPE.get(job_type, "Unknown job type {}".format(job_type))
