Set the quota for the system

    name
        The filesystem to set the quota mode on

    mode
        Whether the quota system is on or off

    quotatype
        Must be ``user`` or ``group``
160138
def mode(name, mode, quotatype):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}
    fun = 'off'
    if mode is True:
        fun = 'on'
    if __salt__['quota.get_mode'](name)[name][quotatype] == fun:
        ret['result'] = True
        ret['comment'] = 'Quota for {0} already set to {1}'.format(name, fun)
        return ret
    if __opts__['test']:
        ret['comment'] = 'Quota for {0} needs to be set to {1}'.format(name,
                                                                       fun)
        return ret
    if __salt__['quota.{0}'.format(fun)](name):
        ret['changes'] = {'quota': name}
        ret['result'] = True
        ret['comment'] = 'Set quota for {0} to {1}'.format(name, fun)
        return ret
    else:
        ret['result'] = False
        ret['comment'] = 'Failed to set quota for {0} to {1}'.format(name, fun)
        return ret
1122213
def update_quota(self, tenant_id, subnet=None, router=None,
                     network=None, floatingip=None, port=None,
                     sec_grp=None, sec_grp_rule=None):
        '''
        
        '''
        body = {}
        if subnet:
            body['subnet'] = subnet
        if router:
            body['router'] = router
        if network:
            body['network'] = network
        if floatingip:
            body['floatingip'] = floatingip
        if port:
            body['port'] = port
        if sec_grp:
            body['security_group'] = sec_grp
        if sec_grp_rule:
            body['security_group_rule'] = sec_grp_rule
        return self.network_conn.update_quota(tenant_id=tenant_id,
                                              body={'quota': body})
322836
def update_available(self, name):
        """"""
        quota = self.usages.get(name, {}).get('quota', float('inf'))
        available = quota - self.usages[name]['used']
        if available < 0:
            available = 0
        self.usages[name]['available'] = available
588162
def reserved_quota(self, reserved_quota):
        
        if reserved_quota is None:
            raise ValueError("Invalid value for `reserved_quota`, must not be `None`")
        if reserved_quota is not None and reserved_quota < 0:
            raise ValueError("Invalid value for `reserved_quota`, must be a value greater than or equal to `0`")

        self._reserved_quota = reserved_quota
773435
def set_user_tags(name, tags, runas=None):
    '''
    '''
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()

    if not isinstance(tags, (list, tuple)):
        tags = [tags]

    res = __salt__['cmd.run_all'](
        [RABBITMQCTL, 'set_user_tags', name] + list(tags),
        reset_system_locale=False,
        runas=runas,
        python_shell=False)
    msg = "Tag(s) set"
    return _format_response(res, msg)
1358504
def SetConfiguredUsers(self, users):
    
    prefix = self.logger.name + '-'
    with tempfile.NamedTemporaryFile(
        mode='w', prefix=prefix, delete=True) as updated_users:
      updated_users_file = updated_users.name
      for user in users:
        updated_users.write(user + '\n')
      updated_users.flush()
      if not os.path.exists(self.google_users_dir):
        os.makedirs(self.google_users_dir)
      shutil.copy(updated_users_file, self.google_users_file)

    file_utils.SetPermissions(self.google_users_file, mode=0o600, uid=0, gid=0)
924870
public void setSystem(java.lang.String system) {
        getStateHelper().put(PropertyKeys.system, system);
        handleAttribute("system", system);
    }
750642
public void setOuFqn(String ouFqn) {

        String userOu = CmsOrganizationalUnit.getParentFqn(m_user.getName());
        if (ouFqn != null) {
            if (ouFqn.startsWith(userOu)
                || (ouFqn.startsWith(CmsOrganizationalUnit.SEPARATOR) && ouFqn.substring(1).startsWith(userOu))) {
                m_ouFqn = ouFqn;
            } else {
                throw new CmsIllegalArgumentException(
                    Messages.get().container(Messages.ERR_BAD_ORGUNIT_2, ouFqn, userOu));
            }
        } else {
            m_ouFqn = userOu;
        }
        m_ouFqn = CmsOrganizationalUnit.removeLeadingSeparator(m_ouFqn);
    }
788373
def _set_sysfs(self, fcp, target_wwpn, target_lun):
        """"""
        device = '0.0.%s' % fcp
        port_add = "echo '%s' > " % target_wwpn
        port_add += "/sys/bus/ccw/drivers/zfcp/%s/port_add" % device
        unit_add = "echo '%s' > " % target_lun
        unit_add += "/sys/bus/ccw/drivers/zfcp/%(device)s/%(wwpn)s/unit_add\n"\
                    % {'device': device, 'wwpn': target_wwpn}
        return '\n'.join((port_add,
                          unit_add))
749779
public void setFileSystems(java.util.Collection<FileSystemDescription> fileSystems) {
        if (fileSystems == null) {
            this.fileSystems = null;
            return;
        }

        this.fileSystems = new com.amazonaws.internal.SdkInternalList<FileSystemDescription>(fileSystems);
    }
333373
def quota(ip=None):
    """"""
    # TODO: Add arbitrary user defined IP check
    url = 'http://www.random.org/quota/?format=plain'
    data = urlopen(url)
    credit = int(data.read().strip())
    if data.code == 200:
        return credit
    else:
        return "ERROR: Server responded with code %s" % data.code
294216
public void setSystemName(String systemName) {
		this.systemName = systemName;
		for (SamzaSystemStream systemStream:systemStreams) {
			systemStream.setSystem(systemName);
		}
	}
310553
private void setupQuota() {
        String quotaPath = Quotas.quotaZookeeper;
        DataNode node = getNode(quotaPath);
        if (node == null) {
            return;
        }
        traverseNode(quotaPath);
    }
95927
protected final void setSystemTag(String name, String value) {
    systemTags.put(name, new SystemTagImpl(name, value));
  }
675765
def update_quota(self, project_id, body=None):
        """"""
        return self.put(self.quota_path % (project_id), body=body)
1235266
private void visit_OP_SET_QUOTA() throws IOException {
    visitTxId();
    v.visitStringUTF8( EditsElement.PATH);
    v.visitLong(       EditsElement.NS_QUOTA);
    v.visitLong(       EditsElement.DS_QUOTA);
  }
99974
def set_option(self, name, value):
        
        if not name in self.settable:
            raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name)

        if name == 'num_jobs':
            try:
                value = int(value)
                if value < 1:
                    raise ValueError
            except ValueError:
                raise SCons.Errors.UserError("A positive integer is required: %s"%repr(value))
        elif name == 'max_drift':
            try:
                value = int(value)
            except ValueError:
                raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
        elif name == 'duplicate':
            try:
                value = str(value)
            except ValueError:
                raise SCons.Errors.UserError("A string is required: %s"%repr(value))
            if not value in SCons.Node.FS.Valid_Duplicates:
                raise SCons.Errors.UserError("Not a valid duplication style: %s" % value)
            # Set the duplicate style right away so it can affect linking
            # of SConscript files.
            SCons.Node.FS.set_duplicate(value)
        elif name == 'diskcheck':
            try:
                value = diskcheck_convert(value)
            except ValueError as v:
                raise SCons.Errors.UserError("Not a valid diskcheck value: %s"%v)
            if 'diskcheck' not in self.__dict__:
                # No --diskcheck= option was specified on the command line.
                # Set this right away so it can affect the rest of the
                # file/Node lookups while processing the SConscript files.
                SCons.Node.FS.set_diskcheck(value)
        elif name == 'stack_size':
            try:
                value = int(value)
            except ValueError:
                raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
        elif name == 'md5_chunksize':
            try:
                value = int(value)
            except ValueError:
                raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
        elif name == 'warn':
            if SCons.Util.is_String(value):
                value = [value]
            value = self.__SConscript_settings__.get(name, []) + value
            SCons.Warnings.process_warn_strings(value)

        self.__SConscript_settings__[name] = value