def image_absent(name):
    '''
    Ensure image is absent on the computenode

    name : string
        uuid of image

    .. note::

        computenode.image_absent will only remove the image if it is not used
        by a vm.
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if name not in __salt__['imgadm.list']():
        # we're good
        ret['result'] = True
        ret['comment'] = 'image {0} is absent'.format(name)
    else:
        # check if image in use by vm
        if name in __salt__['vmadm.list'](order='image_uuid'):
            ret['result'] = False
            ret['comment'] = 'image {0} currently in use by a vm'.format(name)
        else:
            # delete image
            if __opts__['test']:
                ret['result'] = True
            else:
                __salt__['imgadm.delete'](name)
                ret['result'] = name not in __salt__['imgadm.list']()
            ret['comment'] = 'image {0} deleted'.format(name)
            ret['changes'][name] = None

    return ret
dataset/ETHPy150Open saltstack/salt/salt/states/smartos.py/image_absent/original