Delete all server groups from Spacewalk
553295
def deleteAllGroups(server):
    '''
    
    '''

    try:
        client, key = _get_session(server)
    except Exception as exc:
        err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc)
        log.error(err_msg)
        return {'Error': err_msg}

    groups = client.systemgroup.listAllGroups(key)

    deleted_groups = []
    failed_groups = []

    for group in groups:
        if client.systemgroup.delete(key, group['name']) == 1:
            deleted_groups.append(group['name'])
        else:
            failed_groups.append(group['name'])

    ret = {'deleted': deleted_groups}
    if failed_groups:
        ret['failed'] = failed_groups
    return ret
59226
def delete_group(self, name):
        
        self.project_service.set_auth(self._token_project)
        return self.project_service.delete_group(name)
1300351
def delete(self, opts):
        """"""

        argv = opts.args
        count = len(argv)

        # unflagged arguments are conf, stanza, key. In this order
        # however, we must have a conf and stanza.
        cpres = True if count > 0 else False
        spres = True if count > 1 else False
        kpres = True if count > 2 else False 
        
        if not cpres:
            error("Conf name is required for delete", 2)

        if not cpres and not spres:
            error("Conf name and stanza name is required for delete", 2)

        if kpres:
            error("Cannot delete individual keys from a stanza", 2)

        name = argv[0]
        stan = argv[1]
        conf = self.service.confs[name]
        conf.delete(stan)
816389
def remove():
    
    if exists(env.venv_path):
        run("rm -rf %s" % env.venv_path)
    if exists(env.proj_path):
        run("rm -rf %s" % env.proj_path)
    for template in get_templates().values():
        remote_path = template["remote_path"]
        if exists(remote_path):
            sudo("rm %s" % remote_path)
    if exists(env.repo_path):
        run("rm -rf %s" % env.repo_path)
    sudo("supervisorctl update")
    psql("DROP DATABASE IF EXISTS %s;" % env.proj_name)
    psql("DROP USER IF EXISTS %s;" % env.proj_name)
963893
def deleteAll(self):
        
        for core in self.endpoints:
            self._send_solr_command(self.endpoints[core], "{\"delete\": { \"query\" : \"*:*\"}}")
350128
private function clearEmptyGroups()
    {
        foreach (Craft::$app->sites->getAllGroups() as $group) {
            if (count($group->getSites()) == 0) {
                Craft::$app->sites->deleteGroup($group);
            }
        }
    }
1060398
def _destroy_server(self, server_name):
        """"""
        try:
            del self.servers[server_name]
        except KeyError:
            pass

        if self.auto_close and not self.servers:
            loop.stop()
897837
def clean():
    """"""
    run('rm -rf build/')
    run('rm -rf dist/')
    run('rm -rf puzzle.egg-info')
    run('find . -name __pycache__ -delete')
    run('find . -name *.pyc -delete')
    run('find . -name *.pyo -delete')
    run('find . -name *~ -delete')

    log.info('cleaned up')
921386
def delete_from_all_link_group(self, group):
        """"""
        msg = StandardSend(self._address,
                           COMMAND_DELETE_FROM_ALL_LINK_GROUP_0X02_NONE,
                           cmd2=group)
        self._send_msg(msg)
335170
def delete(options = {})
      options = options.merge(launch_configuration_name: @name)
      resp = @client.delete_launch_configuration(options)
      resp.data
    end
1123008
def delete(config, group, force):
        """"""
        if not force:
            if not click.confirm(
                    'Confirm that you want to delete group {}'.format(group)):
                sys.exit("Deletion of {} aborted".format(group))

        client = Client()
        client.prepare_connection()
        group_api = API(client)
        group_api.delete(group)
983022
def delete_group(group_id, purge_data,**kwargs):
    
    user_id = kwargs.get('user_id')
    try:
        group_i = db.DBSession.query(ResourceGroup).filter(ResourceGroup.id == group_id).one()
    except NoResultFound:
        raise ResourceNotFoundError("Group %s not found"%(group_id))

    group_items = db.DBSession.query(ResourceGroupItem).filter(
                                                    ResourceGroupItem.group_id==group_id).all()
    for gi in group_items:
        db.DBSession.delete(gi)

    if purge_data == 'Y':
        _purge_datasets_unique_to_resource('GROUP', group_id)

    log.info("Deleting group %s, id=%s", group_i.name, group_id)

    group_i.network.check_write_permission(user_id)
    db.DBSession.delete(group_i)
    db.DBSession.flush()
986873
def delete_all(self):
        '''
        '''
        try:
            self.conn.indices.delete_mapping(
                index=self.index, doc_type=self.type_tag)
        except TransportError:
            logger.warn('type %r in index %r already deleted',
                        self.index, self.type_tag, exc_info=True)
        try:
            self.conn.indices.delete_mapping(
                index=self.index, doc_type=self.type_assoc)
        except TransportError:
            logger.warn('type %r in index %r already deleted',
                        self.index, self.type_assoc, exc_info=True)
359541
def delete(options = {})
      options = options.merge(db_security_group_name: @name)
      resp = @client.delete_db_security_group(options)
      resp.data
    end
213201
private function cleanupAppServers()
    {
        $allFoundServers = $this->loadAppServerList();
        /** @var \OxidEsales\Eshop\Core\DataObject\ApplicationServer $server */
        foreach ($allFoundServers as $server) {
            if ($server->needToDelete($this->currentTime)) {
                $this->deleteAppServerById($server->getId());
            }
        }
    }
1230795
def delete(options = {})
      options = options.merge(group_name: @name)
      resp = @client.delete_group(options)
      resp.data
    end
887387
def delete_all_tags(self):
        
        j, r = self.datacenter.request('DELETE', self.path + '/tags')
        r.raise_for_status()