Ensure subnet with passed properties is absent.

    name
        Name of the subnet.

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string) that
        contains a dict with region, key and keyid.

def subnet_absent(name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None):
    '''
    Ensure subnet with passed properties is absent.

    name
        Name of the subnet.

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string) that
        contains a dict with region, key and keyid.
    '''

    ret = {'name': name,
           'result': True,
           'comment': '',
           'changes': {}
           }

    r = __salt__['boto_vpc.get_resource_id']('subnet', name=name,
                                             region=region, key=key,
                                             keyid=keyid, profile=profile)
    if 'error' in r:
        ret['result'] = False
        ret['comment'] = 'Failed to delete subnet: {0}.'.format(r['error']['message'])
        return ret

    _id = r.get('id')

    if not _id:
        ret['comment'] = '{0} subnet does not exist.'.format(name)
        return ret

    if __opts__['test']:
        ret['comment'] = 'Subnet {0} ({1}) is set to be removed.'.format(name, r['id'])
        ret['result'] = None
        return ret

    r = __salt__['boto_vpc.delete_subnet'](subnet_name=name,
                                           region=region, key=key,
                                           keyid=keyid, profile=profile)
    if not r.get('deleted'):
        ret['result'] = False
        ret['comment'] = 'Failed to delete subnet: {0}'.format(r['error']['message'])
        return ret

    ret['changes']['old'] = {'subnet': _id}
    ret['changes']['new'] = {'subnet': None}
    ret['comment'] = 'Subnet {0} deleted.'.format(name)
    return ret