Exit from configuration mode.

        :param exit_config: Command to exit configuration mode
        :type exit_config: str

        :param pattern: Pattern to terminate reading of channel
        :type pattern: str
971474
def exit_config_mode(self, exit_config="", pattern=""):
        
        output = ""
        if self.check_config_mode():
            self.write_channel(self.normalize_cmd(exit_config))
            output = self.read_until_pattern(pattern=pattern)
            if self.check_config_mode():
                raise ValueError("Failed to exit configuration mode")
        log.debug("exit_config_mode: {}".format(output))
        return output
985613
def config_mode(self, config_command="config term", pattern=""):
        
        if not pattern:
            pattern = re.escape(self.base_prompt[:16])
        return super(CiscoBaseConnection, self).config_mode(
            config_command=config_command, pattern=pattern
        )
767351
public static final void exit(TraceComponent tc, String methodName) {
        TrConfigurator.getDelegate().exit(tc, methodName);
    }
672827
def exit_config_mode(self, exit_config="exit all", pattern="#"):
        
        return super(AlcatelSrosSSH, self).exit_config_mode(
            exit_config=exit_config, pattern=pattern
        )
1048891
def exit(self, code=0, message=None):
        

        ## If we have a parser, use it to exit
        if self._parser:
            if code > 0:
                self.parser.error(message)
            else:
                self.parser.exit(code, message)

        ## Else we are exiting before parser creation
        else:
            if message is not None:
                if code > 0:
                    sys.stderr.write(message)
                else:
                    sys.stdout.write(message)
            sys.exit(code)

        ## If we're here we didn't exit for some reason?
        raise Exception("Unable to exit the %s" % self.__class__.__name__)
1261369
def _possibly_exit_with_help(parser, known_args):
        
        if known_args.core_help or known_args.core_help_all:
            parser.print_help()
            sys.exit()
1036402
def exit():
        
        exit_msg = None
        try:
            loop = asyncio.get_event_loop()
            loop.stop()
        except Exception as e:
            logging.error('Could not stop loop: %s\nShutting down anyway..',
                          str(e))
1038225
def check_config_mode(self, check_string=">config", pattern=""):
        
        return super(RadETXBase, self).check_config_mode(
            check_string=check_string, pattern=pattern
        )
737346
def cmd_terminate(self, argv, help):
        """"""
        from ploy.common import yesno
        parser = argparse.ArgumentParser(
            prog="%s terminate" % self.progname,
            description=help,
        )
        instances = self.get_instances(command='terminate')
        parser.add_argument("instance", nargs=1,
                            metavar="instance",
                            help="Name of the instance from the config.",
                            choices=sorted(instances))
        args = parser.parse_args(argv)
        instance = instances[args.instance[0]]
        if not yesno("Are you sure you want to terminate '%s'?" % instance.config_id):
            return
        instance.hooks.before_terminate(instance)
        instance.terminate()
        instance.hooks.after_terminate(instance)
680508
def check_config_mode(self, check_string="config", pattern=""):
        """"""
        if not pattern:
            pattern = re.escape(self.base_prompt)
        return super(CiscoWlcSSH, self).check_config_mode(check_string, pattern)
399980
def quit(self, exit_code=0, event=None):
        

        # --- Running on_close components methods. ---
        for component in reversed(self.__components_manager.list_components()):
            interface = self.__components_manager.get_interface(component)
            if not interface:
                continue

            if not interface.activated:
                continue

            if not hasattr(interface, "on_close"):
                continue

            if not interface.on_close():
                event and event.ignore()
                return

        # Storing current layout.
        self.__layouts_manager.store_startup_layout()
        self.__settings.settings.sync()

        # Stopping worker threads.
        for worker_thread in self.__worker_threads:
            LOGGER.debug("> Stopping worker thread: '{0}'.".format(worker_thread))
            if not worker_thread.isFinished():
                worker_thread.quit()
            worker_thread.wait()

        foundations.verbose.remove_logging_handler(self.__logging_file_handler)
        foundations.verbose.remove_logging_handler(self.__logging_session_handler)
        # foundations.verbose.remove_logging_handler(self.__logging_console_handler)

        # Stopping the Application timer.
        self.__timer.stop()
        self.__timer = None

        self.deleteLater()
        event and event.accept()

        exit(exit_code)
1367193
def exit_with_error(msg):
    '''
    
    '''
    msg += '\n'
    msg += 'Local job workspaces can be found in: ' + str(environ.get('DX_TEST_JOB_HOMEDIRS'))
    sys.exit(msg)
988133
def setup_contracts_or_exit(
        config: Dict[str, Any],
        network_id: int,
) -> Dict[str, Any]:
    
    environment_type = config['environment_type']

    not_allowed = (  # for now we only disallow mainnet with test configuration
        network_id == 1 and
        environment_type == Environment.DEVELOPMENT
    )
    if not_allowed:
        click.secho(
            f'The chosen network ({ID_TO_NETWORKNAME[network_id]}) is not a testnet, '
            f'but the "development" environment was selected.\n'
            f'This is not allowed. Please start again with a safe environment setting '
            f'(--environment production).',
            fg='red',
        )
        sys.exit(1)

    contracts = dict()
    contracts_version = environment_type_to_contracts_version(environment_type)

    config['contracts_path'] = contracts_precompiled_path(contracts_version)

    if network_id in ID_TO_NETWORKNAME and ID_TO_NETWORKNAME[network_id] != 'smoketest':
        try:
            deployment_data = get_contracts_deployment_info(
                chain_id=network_id,
                version=contracts_version,
            )
        except ValueError:
            return contracts, False

        contracts = deployment_data['contracts']

    return contracts
72287
function exit(inst, state, fin) {
    return fin(_wrapError(_outOfGasError(inst), inst, state), state);
}
843280
def cleanup(self):
        """"""
        try:
            self.exit_config_mode()
        except Exception:
            # Always try to send 'exit' regardless of whether exit_config_mode works or not.
            pass
        self._session_log_fin = True
        self.write_channel("exit" + self.RETURN)
711224
def exit(self, signal=None, frame=None):
        
        self.input_channel.close()
        self.client_queue.close()
        self.connection.close()
        log.info("Worker exiting")
        sys.exit(0)
493518
def exit_config_mode(self, exit_config="exit", pattern=r">"):
        """"""
        return super(PaloAltoPanosBase, self).exit_config_mode(
            exit_config=exit_config, pattern=pattern
        )