sets the Microsoft Windows/Samba (SMB/CIFS) service.
549102
def set_cifs_service(domain = nil, username = nil, password = nil)
      self.domain    = domain
      self.user_name = username
      self.password  = password
      self.service   = Credential::Service::CIFS
    end
1224608
protected function set_storage_prop()
    {
        $storage = $this->get_storage();

        // set pagesize from config
        $pagesize = $this->config->get('mail_pagesize');
        if (!$pagesize) {
            $pagesize = $this->config->get('pagesize', 50);
        }

        $storage->set_pagesize($pagesize);
        $storage->set_charset($this->config->get('default_charset', RCUBE_CHARSET));

        // enable caching of mail data
        $driver         = $this->config->get('storage_driver', 'imap');
        $storage_cache  = $this->config->get("{$driver}_cache");
        $messages_cache = $this->config->get('messages_cache');
        // for backward compatybility
        if ($storage_cache === null && $messages_cache === null && $this->config->get('enable_caching')) {
            $storage_cache  = 'db';
            $messages_cache = true;
        }

        if ($storage_cache) {
            $storage->set_caching($storage_cache);
        }
        if ($messages_cache) {
            $storage->set_messages_caching(true);
        }
    }
316178
def _sysv_enable(name):
    '''
    
    '''
    if not _service_is_chkconfig(name) and not _chkconfig_add(name):
        return False
    cmd = '/sbin/chkconfig {0} on'.format(name)
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
1211109
def allocate(self):
        """"""
        disk_path = self.provider_image

        self._hypervisor = libvirt.open(
            self.configuration.get('hypervisor', 'vbox:///session'))

        self._domain = domain_create(self._hypervisor, self.identifier,
                                     self.configuration['domain'], disk_path)
722928
def _set_distro(self):
        """"""
        if self.distro_name == 'sles':
            self.distro = SLES()
        elif self.distro_name == 'opensuse_leap':
            self.distro = openSUSE_Leap()
        else:
            raise IpaCloudException(
                'Distribution: %s, not supported.' % self.distro_name
            )
1178985
def set_shares(self):
        
        if self.filename is None:
            self.filenamename = os.path.expanduser(
                '~%s/%s' % (self.host_username, FILE_RC))
        if not os.path.exists(self.filename):
            error_msg = (u"Impossibile trovare il file di configurazione "
                         u"'%s'.\nLe unità di rete non saranno collegate." % (
                             FILE_RC.lstrip('.')))
            if not self.shell_mode:
                ErrorMessage(error_msg)
            logging.error(error_msg)
            sys.exit(5)
        if self.verbose:
            logging.warning("File RC utilizzato: %s", self.filename)
        self.samba_shares = read_config(self.filename)
280446
def _setup(self):
        """"""
        agent_config = CONF.get("AGENT", {})
        self._worker_count = agent_config.get('worker_count')
        self._phys_net_map = agent_config.get(
            'physical_network_vswitch_mappings', [])
        self._local_network_vswitch = agent_config.get(
            'local_network_vswitch')
        self._load_physical_network_mappings(self._phys_net_map)
        self._validate_vswitches()

        self._endpoints.append(self)
        self._event_callback_pairs.extend([
            (self._utils.EVENT_TYPE_CREATE, self._process_added_port_event),
            (self._utils.EVENT_TYPE_DELETE, self._process_removed_port_event)
        ])

        tpool.set_num_threads(self._worker_count)
474853
protected function installFilesystem()
    {
        try {
            if(! ($this->getServiceManager()->get(FileSystemService::SERVICE_ID) instanceof FileSystemService)) {
                throw new InvalidService('Your service must be a oat\oatbox\filesystem\FileSystemService');
            }
        } catch(ServiceNotFoundException $e){
            $fileSystemService = new FileSystemService(array(FileSystemService::OPTION_FILE_PATH => $this->getOption('file_path')));
            $this->getServiceManager()->register(FileSystemService::SERVICE_ID, $fileSystemService);
        }
    }
738392
public function setConfiguration( models\NetworkShare\SambaConfig $sambaConfig){
        $rest = $this->getService( self::API_NETWORK_SHARE_SAMBA);
        $rest->PUT( $sambaConfig);

        return $rest->getResult( models\NetworkShare\SambaConfig::class);
    }
1282046
def configure(self, value):
        """"""

        # Only accept new SBIs if the SDP is on.
        if self._sdp_state.current_state != 'on':
            raise RuntimeWarning('Unable to configure SBIs unless SDP is '
                                 '\'on\'.')

        # Check that the new SBI is not already registered.
        sbi_config_dict = json.loads(value)
        sbi_list = SchedulingBlockInstanceList()
        LOG.info('SBIs before: %s', sbi_list.active)
        if sbi_config_dict.get('id') in sbi_list.active:
            raise RuntimeWarning('Unable to add SBI with ID {}, an SBI with '
                                 'this ID is already registered with SDP!'
                                 .format(sbi_config_dict.get('id')))

        # Add the SBI to the dictionary.
        LOG.info('Scheduling offline SBI! Config:\n%s', value)
        sbi = SchedulingBlockInstance.from_config(sbi_config_dict)
        LOG.info('SBIs after: %s', sbi_list.active)

        sbi_pb_ids = sbi.processing_block_ids
        LOG.info('SBI "%s" contains PBs: %s', sbi.id, sbi_pb_ids)
        # pb_list = ProcessingBlockList()
        # LOG.info('Active PBs: %s', pb_list.active)

        # Get the list and number of Tango PB devices
        tango_db = Database()
        pb_device_class = "ProcessingBlockDevice"
        pb_device_server_instance = "processing_block_ds/1"
        pb_devices = tango_db.get_device_name(pb_device_server_instance,
                                              pb_device_class)
        LOG.info('Number of PB devices in the pool = %d', len(pb_devices))

        # Get a PB device which has not been assigned.
        for pb_id in sbi_pb_ids:
            for pb_device_name in pb_devices:
                device = DeviceProxy(pb_device_name)

                if not device.pb_id:
                    LOG.info('Assigning PB device = %s to PB id = %s',
                             pb_device_name, pb_id)
                    # Set the device attribute 'pb_id' to the processing block
                    # id it is tracking.
                    device.pb_id = pb_id
                    break
159280
protected function setAuthorizes()
    {
        $filesystem = new Filesystem;

        $files = $filesystem->glob(app_path('Admin/Controllers/*.php'));

        $authorizes = [];

        foreach ($files as $key => $value) {
            $str = Str::snake(Str::replaceLast('Controller.php', '', basename($value)));

            if (!in_array($str, $this->ignores) && !in_array($str, $this->administrators)) {
                $authorizes[] = [
                    'title' => trans('admin::' . $str . '.heading.catalog'),
                    'value' => $str,
                ];
            }

        }
        $this->authorizes = $authorizes;
    }
849360
def _setup_fd(fd):
    """"""

    # Make the file nonblocking (but don't lose its previous flags)
    flags = fcntl.fcntl(fd, fcntl.F_GETFL)
    fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK)
    set_buf_size(fd)
837335
def set_oracle_service(sid = nil, username = nil, password = nil)
      self.database  = sid
      self.user_name = username
      self.password  = password
      self.service   = Credential::Service::ORACLE
    end
268448
def _set_allowed_services_and_actions(self, services):
        """"""
        for service in services:
            self.services[service['name']] = {}

            for action in service['actions']:
                name = action.pop('name')
                self.services[service['name']][name] = action
1031443
private function configure(): void
    {
        $services = array_keys($this->container->findTaggedServiceIds('app.service'));
        foreach ($services as $service) {
            $service = $this->container->get($service);
            $this->services[$service->getName()] = $service;
        }
    }
825671
def _set_sysfs(self, fcp, target_wwpn, target_lun):
        """"""
        device = '0.0.%s' % fcp
        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 unit_add
410475
def set_settings(self, releases=None, default_release=None):
        """"""
        super(ReplicaSets, self).set_settings(releases, default_release)
        Servers().set_settings(releases, default_release)