Enter into configuration mode on SROS device.
192780
def config_mode(self, config_command="configure", pattern="#"):
        
        return super(AlcatelSrosSSH, self).config_mode(
            config_command=config_command, pattern=pattern
        )
1195806
def set_auto_configuration(config, hostname, ca_cert, proxy, is_satellite):
    
    logger.debug("Attempting to auto configure!")
    logger.debug("Attempting to auto configure hostname: %s", hostname)
    logger.debug("Attempting to auto configure CA cert: %s", ca_cert)
    logger.debug("Attempting to auto configure proxy: %s", proxy)
    saved_base_url = config.base_url
    if ca_cert is not None:
        saved_cert_verify = config.cert_verify
        config.cert_verify = ca_cert
    if proxy is not None:
        saved_proxy = config.proxy
        config.proxy = proxy
    if is_satellite:
        # satellite
        config.base_url = hostname + '/r/insights'
        if not config.legacy_upload:
            config.base_url += '/platform'
        logger.debug('Auto-configured base_url: %s', config.base_url)
    else:
        # connected directly to RHSM
        if config.legacy_upload:
            config.base_url = hostname + '/r/insights'
        else:
            config.base_url = hostname + '/api'
        logger.debug('Auto-configured base_url: %s', config.base_url)
        logger.debug('Not connected to Satellite, skipping branch_info')
        # direct connection to RHSM, skip verify_connectivity
        return

    if not verify_connectivity(config):
        logger.warn("Could not auto configure, falling back to static config")
        logger.warn("See %s for additional information",
                    constants.default_log_file)
        config.base_url = saved_base_url
        if proxy is not None:
            if saved_proxy is not None and saved_proxy.lower() == 'none':
                saved_proxy = None
            config.proxy = saved_proxy
        if ca_cert is not None:
            config.cert_verify = saved_cert_verify
587587
def autoconf(self):
        
        opcinfo = OPCinfo(self._host, self._port, self._user, self._password, 
                          self._monpath, self._ssl)
        return opcinfo is not None
932740
def ready(self):
        """"""
        super(ElasticAppConfig, self).ready()
        _validate_config(settings.get_setting("strict_validation"))
        _connect_signals()
182925
def ready(self, source):
        """"""

        from hfos.database import configschemastore
        configschemastore[self.name] = self.configschema

        self._start_server()

        if not self.insecure:
            self._drop_privileges()

        self.fireEvent(cli_register_event('components', cli_components))
        self.fireEvent(cli_register_event('drop_privileges', cli_drop_privileges))
        self.fireEvent(cli_register_event('reload_db', cli_reload_db))
        self.fireEvent(cli_register_event('reload', cli_reload))
        self.fireEvent(cli_register_event('quit', cli_quit))
        self.fireEvent(cli_register_event('info', cli_info))
722216
def __require_kytos_config(self):
        
        if self.__enabled is None:
            uri = self._kytos_api + 'api/kytos/core/config/'
            try:
                options = json.loads(urllib.request.urlopen(uri).read())
            except urllib.error.URLError:
                print('Kytos is not running.')
                sys.exit()
            self.__enabled = Path(options.get('napps'))
            self.__installed = Path(options.get('installed_napps'))
1120922
def setup(ctx, force):
    """"""
    if os.path.exists(USER_CONFIG) and not force:
        click.secho(
            'An existing configuration file was found at "{}".\n'
            .format(USER_CONFIG),
            fg='red', bold=True
        )
        click.secho(
            'Please remove it before in order to run the setup wizard or use\n'
            'the --force flag to overwrite it.'
        )
        ctx.exit(1)

    click.echo('Address of the issue tracker (your JIRA instance). \n'
               'Normally in the form https://<company>.atlassian.net.')
    tracker_url = click.prompt('URL')
    tracker_user = click.prompt('Username for {}'.format(tracker_url))
    click.echo()

    click.echo('Address of the time tracker (your Harvest instance). \n'
               'Normally in the form https://<company>.harvestapp.com.')
    timer_url = click.prompt('URL')
    timer_user = click.prompt('Username for {}'.format(timer_url))
    click.echo()

    config = configparser.ConfigParser()

    config.add_section('tracker')
    config.set('tracker', 'url', tracker_url)
    config.set('tracker', 'username', tracker_user)

    config.add_section('harvest')
    config.set('harvest', 'url', timer_url)
    config.set('harvest', 'username', timer_user)

    with open(USER_CONFIG, 'w') as fh:
        config.write(fh)

    click.secho('Configuration correctly written to "{}".'
                .format(USER_CONFIG), fg='green')
74449
def setup_config(command, filename, section, vars):
    """"""
    conf = appconfig('config:' + filename)
    load_environment(conf.global_conf, conf.local_conf)
479157
private static String[] adjustConf(String[] argv, Configuration conf) {
    String[] serviceId = new String[] { "" };
    String[] filteredArgv = DFSUtil.getServiceName(argv, serviceId);
    
    if (!serviceId[0].equals("")) {
      NameNode.checkServiceName(conf, serviceId[0]);
      DFSUtil.setGenericConf(conf, serviceId[0],
          NameNode.NAMESERVICE_SPECIFIC_KEYS);
      NameNode.setupDefaultURI(conf);
    }
    
    // make it avatar aware (manual option)
    if (optionExist(argv, "-one")) {
      updateConfKeys(conf, "1", serviceId[0]);
    } else {
      updateConfKeys(conf, "0", serviceId[0]);
    }
    return filteredArgv;
  }
773017
def update_config_mode(self, prompt):  # pylint: disable=no-self-use
        """"""
        mode = 'global'
        if prompt:
            if 'config' in prompt:
                mode = 'config'
            elif 'admin' in prompt:
                mode = 'admin'

        self.log("Mode: {}".format(mode))
        return mode
609333
def config(self, settings):
        
        self.debug("()")
        # TODO synchronize access to vars
        try:
            self._device_id = settings['device_id']

            self._packet_timeout = settings.get(
                'packet_wait_timeout',
                self._packet_timeout
            )
            self._server_ip = settings.get('server_ip', self._server_ip)
            self._server_port = settings.get('server_port', self._server_port)
        except KeyError:
            raise SensorUpdateException("Key not in settings")

        if callable(self.on_config):
            try:
                self.on_config(settings)
            except:
                self.exception("Failed to update remote config")
                raise SensorUpdateException("Remote config failed")
561622
def cli(env, identifier, enable):
    """"""

    mgr = SoftLayer.HardwareManager(env.client)
    hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware')
    result = env.client['Hardware_Server'].toggleManagementInterface(enable, id=hw_id)
    env.fout(result)
298146
def autoconf(self):
        
        lighttpdInfo = LighttpdInfo(self._host, self._port,
                                self._user, self._password, 
                                self._statuspath, self._ssl)
        return lighttpdInfo is not None
748686
def init():
    """"""
    default_config_path = path.join(
        (os.environ.get('TLDR_CONFIG_DIR') or path.expanduser('~')),
        '.tldrrc')
    if path.exists(default_config_path):
        click.echo("There is already a config file exists, "
                   "skip initializing it.")
    else:
        repo_path = click.prompt("Input the tldr repo path(absolute path)")
        if not path.exists(repo_path):
            sys.exit("Repo path not exist, clone it first.")

        platform = click.prompt("Input your platform(linux, osx or sunos)")
        if platform not in ['linux', 'osx', 'sunos']:
            sys.exit("Platform should be in linux, osx or sunos.")

        colors = {
            "description": "blue",
            "usage": "green",
            "command": "cyan"
        }

        config = {
            "repo_directory": repo_path,
            "colors": colors,
            "platform": platform
        }
        with open(default_config_path, 'w') as f:
            f.write(yaml.safe_dump(config, default_flow_style=False))

        click.echo("Initializing the config file at {0}".format(
            default_config_path))
67423
def register_opts(conf):
    """"""
    conf.register_cli_opts(CLI_OPTS)
    conf.register_opts(EPISODE_OPTS)
    conf.register_opts(FORMAT_OPTS)
    conf.register_opts(CACHE_OPTS, 'cache')
365199
def init(opts):
    '''
    
    '''
    if 'host' not in opts['proxy']:
        log.critical('No \'host\' key found in pillar for this proxy.')
        return False
    if 'apikey' not in opts['proxy']:
        # If we do not have an apikey, we must have both a username and password
        if 'username' not in opts['proxy']:
            log.critical('No \'username\' key found in pillar for this proxy.')
            return False
        if 'password' not in opts['proxy']:
            log.critical('No \'passwords\' key found in pillar for this proxy.')
            return False

    DETAILS['url'] = 'https://{0}/api/'.format(opts['proxy']['host'])

    # Set configuration details
    DETAILS['host'] = opts['proxy']['host']
    if 'serial' in opts['proxy']:
        DETAILS['serial'] = opts['proxy'].get('serial')
        if 'apikey' in opts['proxy']:
            log.debug("Selected pan_key method for panos proxy module.")
            DETAILS['method'] = 'pan_key'
            DETAILS['apikey'] = opts['proxy'].get('apikey')
        else:
            log.debug("Selected pan_pass method for panos proxy module.")
            DETAILS['method'] = 'pan_pass'
            DETAILS['username'] = opts['proxy'].get('username')
            DETAILS['password'] = opts['proxy'].get('password')
    else:
        if 'apikey' in opts['proxy']:
            log.debug("Selected dev_key method for panos proxy module.")
            DETAILS['method'] = 'dev_key'
            DETAILS['apikey'] = opts['proxy'].get('apikey')
        else:
            log.debug("Selected dev_pass method for panos proxy module.")
            DETAILS['method'] = 'dev_pass'
            DETAILS['username'] = opts['proxy'].get('username')
            DETAILS['password'] = opts['proxy'].get('password')

    # Ensure connectivity to the device
    log.debug("Attempting to connect to panos proxy host.")
    query = {'type': 'op', 'cmd': '<show><system><info></info></system></show>'}
    call(query)
    log.debug("Successfully connected to panos proxy host.")

    DETAILS['initialized'] = True
625453
public static function configureAsRoot(): void
    {
        $filesystem = new Filesystem();
        $vendor_dir = Path::VENDOR_DIR . '/hostnet/phpcs-tool/src';
        if ($filesystem->exists($vendor_dir)) {
            return;
        }

        self::configure();

        $filesystem->mkdir($vendor_dir . '/Hostnet');
        $filesystem->symlink(__DIR__ . '/../../Sniffs', $vendor_dir . '/Hostnet/Sniffs');
        $filesystem->copy(__DIR__ . '/../../ruleset.xml', $vendor_dir . '/Hostnet/ruleset.xml');

        $filesystem->mkdir($vendor_dir . '/HostnetPaths');
        $filesystem->copy(__DIR__ . '/../../../HostnetPaths/ruleset.xml', $vendor_dir . '/HostnetPaths/ruleset.xml');
    }