Ensure that the named stack is absent

    name
        The name of the stack to remove

    poll
        Poll(in sec.) and report events until stack complete

    timeout
        Stack creation timeout in minutes

    profile
        Profile to use
964509
def absent(name, poll=5, timeout=60, profile=None):
    '''
    

    '''
    log.debug('Absent with (%s, %s %s)', name, poll, profile)
    ret = {'name': None,
           'comment': '',
           'changes': {},
           'result': True}
    if not name:
        ret['result'] = False
        ret['comment'] = 'Name ist not valid'
        return ret

    ret['name'] = name,

    existing_stack = __salt__['heat.show_stack'](name, profile=profile)

    if not existing_stack['result']:
        ret['result'] = True
        ret['comment'] = 'Stack not exist'
        return ret
    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Stack {0} is set to be removed'.format(name)
        return ret

    stack = __salt__['heat.delete_stack'](name=name, poll=poll,
                                          timeout=timeout, profile=profile)

    ret['result'] = stack['result']
    ret['comment'] = stack['comment']
    ret['changes']['stack_name'] = name
    ret['changes']['comment'] = 'Delete stack'
    return ret
1223489
void popStackToClose(String... elNames) {
        for (int pos = stack.size() -1; pos >= 0; pos--) {
            Element next = stack.get(pos);
            stack.remove(pos);
            if (inSorted(next.normalName(), elNames))
                break;
        }
    }
642579
def absent(version,
           name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}

    #check if cluster exists and remove it
    if __salt__['postgres.cluster_exists'](version, name):
        if __opts__.get('test'):
            ret['result'] = None
            msg = 'Cluster {0}/{1} is set to be removed'
            ret['comment'] = msg.format(version, name)
            return ret
        if __salt__['postgres.cluster_remove'](version, name, True):
            msg = 'Cluster {0}/{1} has been removed'
            ret['comment'] = msg.format(version, name)
            ret['changes'][name] = 'Absent'
            return ret

    # fallback
    ret['comment'] = 'Cluster {0}/{1} is not present, so it cannot ' \
                     'be removed'.format(version, name)
    return ret
125987
private void onRemove(final String name) {
        Feedback.confirm(Console.MESSAGES.deleteTitle(title),
                Console.MESSAGES.deleteConfirm(title + " '" + name + "'"),
                isConfirmed -> {
                    if (isConfirmed) {
                        circuit.dispatch(new DeleteConfig(addressTemplate, name));
                    }
                });
    }
561630
def wait_for_instance_deletion(self, credentials, name, **kwargs):
        """"""
        op_name = wait_for_instance_deletion(
            credentials, self.project, self.zone, name, **kwargs)

        return op_name
691839
def stack_status(stack_name)
      return true if testing_update?
      return false if @options[:noop]

      resp = cfn.describe_stacks(stack_name: stack_name)
      status = resp.stacks[0].stack_status
    end
37427
def hold_absent(name, snapshot, recursive=False):
    '''
    

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

    ## log configuration
    log.debug('zfs.hold_absent::%s::config::snapshot = %s',
              name, snapshot)
    log.debug('zfs.hold_absent::%s::config::recursive = %s',
              name, recursive)

    ## check we have a snapshot/tag name
    if not __utils__['zfs.is_snapshot'](snapshot):
        ret['result'] = False
        ret['comment'] = 'invalid snapshot name: {0}'.format(snapshot)
        return ret

    if __utils__['zfs.is_snapshot'](name) or \
       __utils__['zfs.is_bookmark'](name) or \
       name == 'error':
        ret['result'] = False
        ret['comment'] = 'invalid tag name: {0}'.format(name)
        return ret

    ## release hold if required
    holds = __salt__['zfs.holds'](snapshot)
    if name in holds:
        ## NOTE: hold found for snapshot, release it
        if not __opts__['test']:
            mod_res = __salt__['zfs.release'](name, snapshot, **{'recursive': recursive})
        else:
            mod_res = OrderedDict([('released', True)])

        ret['result'] = mod_res['released']
        if ret['result']:
            ret['changes'] = {snapshot: {name: 'released'}}
            ret['comment'] = 'hold {0} released'.format(
                name,
            )
        else:
            ret['comment'] = 'failed to release hold {0}'.format(
                name,
            )
            if 'error' in mod_res:
                ret['comment'] = mod_res['error']
    elif 'error' in holds:
        ## NOTE: we have an error
        ret['result'] = False
        ret['comment'] = holds['error']
    else:
        ## NOTE: no hold found with name for snapshot
        ret['comment'] = 'hold {0} is absent'.format(
            name,
        )

    return ret
828977
def list_stack(profile=None):
    '''
    
    '''
    ret = {}
    h_client = _auth(profile)
    for stack in h_client.stacks.list():
        links = {}
        for link in stack.links:
            links[link['rel']] = link['href']
        ret[stack.stack_name] = {
            'status': stack.stack_status,
            'id': stack.id,
            'name': stack.stack_name,
            'creation': stack.creation_time,
            'owner': stack.stack_owner,
            'reason': stack.stack_status_reason,
            'links': links,
        }
    return ret
364449
public function profileEnd($name)
    {
        if (!is_string($name) || empty($name) || empty($this->_profileStacks)) {
            return;
        }

        if (!empty($this->_profileStacks[$name])) {
            $this->profile($name, microtime(true) - $this->_profileStacks[$name]);
        }
    }
383525
def absent(name=None, ipv4addr=None, **api_opts):
    '''
    
    '''
    ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}
    obj = __salt__['infoblox.get_a'](name=name, ipv4addr=ipv4addr, allow_array=False, **api_opts)

    if not obj:
        ret['result'] = True
        ret['comment'] = 'infoblox already removed'
        return ret

    if __opts__['test']:
        ret['result'] = None
        ret['changes'] = {'old': obj, 'new': 'absent'}
        return ret

    if __salt__['infoblox.delete_a'](name=name, ipv4addr=ipv4addr, **api_opts):
        ret['result'] = True
        ret['changes'] = {'old': obj, 'new': 'absent'}
    return ret
966709
def absent(name, keys=None, **connection_args):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Key(s) specified already absent'}

    if keys:
        if not isinstance(keys, list):
            ret['result'] = False
            ret['comment'] = '`keys` not formed as a list type'
            return ret
        delete_list = [key for key in keys
                       if __salt__['redis.exists'](key, **connection_args)]
        if not delete_list:
            return ret
        __salt__['redis.delete'](*delete_list, **connection_args)
        ret['changes']['deleted'] = delete_list
        ret['comment'] = 'Keys deleted'
        return ret

    if __salt__['redis.exists'](name, **connection_args):
        __salt__['redis.delete'](name, **connection_args)
        ret['comment'] = 'Key deleted'
        ret['changes']['deleted'] = [name]
    return ret
370333
def update_stack(name, template_body=None, template_url=None, parameters=None, notification_arns=None,
                 disable_rollback=False, timeout_in_minutes=None, capabilities=None, tags=None,
                 use_previous_template=None, stack_policy_during_update_body=None, stack_policy_during_update_url=None,
                 stack_policy_body=None, stack_policy_url=None, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        update = conn.update_stack(name, template_body, template_url, parameters, notification_arns,
                                   disable_rollback, timeout_in_minutes, capabilities, tags, use_previous_template,
                                   stack_policy_during_update_body, stack_policy_during_update_url,
                                   stack_policy_body, stack_policy_url)
        log.debug('Updated result is : %s.', update)
        return update
    except BotoServerError as e:
        msg = 'Failed to update stack {0}.'.format(name)
        log.debug(e)
        log.error(msg)
        return six.text_type(e)
871528
def absent(name, auth=None, **kwargs):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}

    kwargs = __utils__['args.clean_kwargs'](**kwargs)

    __salt__['keystoneng.setup_cloud'](auth)

    kwargs['name'] = name
    group = _common(kwargs)

    if group:
        if __opts__['test'] is True:
            ret['result'] = None
            ret['changes'] = {'id': group.id}
            ret['comment'] = 'Group will be deleted.'
            return ret

        __salt__['keystoneng.group_delete'](name=group)
        ret['changes']['id'] = group.id
        ret['comment'] = 'Deleted group'

    return ret
243760
def delete_stack(stack):
    
    global CACHE_
    key = "{0}.{1}".format(stack.module, stack.caller)
    if key in CACHE_['stacks']:
        del CACHE_['stacks'][key]
        write_out()
849682
def should_submit(stack):
    
    if stack.enabled:
        return True

    logger.debug("Stack %s is not enabled.  Skipping.", stack.name)
    return False
384575
def pop_identity(self):
        
        popped = None
        stack = self.get_run_as_identifiers_stack()

        if (stack):
            popped = stack.pop()
            if (stack):
                # persist the changed stack to the session
                session = self.get_session()
                session.set_internal_attribute(self.run_as_identifiers_session_key, stack)

            else:
                # stack is empty, remove it from the session:
                self.clear_run_as_identities()
        return popped
856371
def profile_remove(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('profile:remove', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })