Capture the show configuration failed result.
162395
def a_capture_show_configuration_failed(ctx):
    """"""
    result = ctx.device.send("show configuration failed")
    ctx.device.last_command_result = result
    index = result.find("SEMANTIC ERRORS")
    ctx.device.chain.connection.emit_message(result, log_level=logging.ERROR)
    if index > 0:
        raise ConfigurationSemanticErrors(result)
    else:
        raise ConfigurationErrors(result)
520197
def cmd_config_show(option, show_keys):
    

    habucfg = loadcfg()

    if not show_keys:
        for key in habucfg.keys():
            if 'KEY' in key:
                habucfg[key] = '*************'

    print(json.dumps(habucfg, indent=4, sort_keys=True, default=str))
546417
def saveConfig(self, request):
        """"""
        res = yield self.assertAllowed(request)
        if res:
            defer.returnValue(res)
        request.setHeader('Content-Type', 'application/json')
        if self._in_progress:
            defer.returnValue(json.dumps({'success': False, 'errors': ['reconfig already in progress']}))
        self._in_progress = True
        cfg = json.loads(request.content.read())
        if cfg != self._cfg:
            try:
                err = yield self.saveCfg(cfg)
            except Exception as e:  # noqa
                err = [repr(e)]
            if err is not None:
                self._in_progress = False
                yield self.saveCfg(self._cfg)
                defer.returnValue(json.dumps({'success': False, 'errors': err}))

        yield self.ep.master.reconfig()
        defer.returnValue(json.dumps({'success': True}))
413316
def _upload_config_content(self, configuration, rollbacked=False):
        """"""
        try:
            for configuration_line in configuration.splitlines():
                self._device.cli(configuration_line)
            self._config_changed = True  # configuration was changed
            self._committed = False  # and not committed yet
        except (pyPluribus.exceptions.CommandExecutionError,
                pyPluribus.exceptions.TimeoutError) as clierr:
            if not rollbacked:
                # rollack errors will just trow
                # to avoid loops
                self.discard()
            raise pyPluribus.exceptions.ConfigLoadError("Unable to upload config on the device: {err}.\
                Configuration will be discarded.".format(err=clierr.message))
        return True
879786
def message_failure(self):
        
        if not isinstance(self.main_manifest, Manifest):
            return None
        return self.main_manifest.get('config', 'message_failure', default=None)
886657
def show_configure(self):
        
        logging.info("Displaying configuration window")
        self.configWindow.show()
        self.configWindow.showNormal()
        self.configWindow.activateWindow()
757437
def _handle_app_result_build_failure(self,out,err,exit_status,result_paths):
        

        try:
            raise ApplicationError, \
             'RAxML failed to produce an output file due to the following error: \n\n%s ' \
             % err.read()
        except:
            raise ApplicationError,\
                'RAxML failed to run properly.'
1330259
def show():
    
    if not is_configured():
        raise JutException('No configurations available, please run: `jut config add`')

    info('Available jut configurations:')
    index = 0
    for configuration in _CONFIG.sections():
        username = _CONFIG.get(configuration, 'username')
        app_url = _CONFIG.get(configuration, 'app_url')

        if app_url != defaults.APP_URL:
            if _CONFIG.has_option(configuration, 'default'):
                info(' %d: %s@%s (default)', index + 1, username, app_url)
            else:
                info(' %d: %s@%s', index + 1, username, app_url)

        else:
            if _CONFIG.has_option(configuration, 'default'):
                info(' %d: %s (default)' % (index + 1, username))
            else:
                info(' %d: %s' % (index + 1, username))

        index += 1
1224372
def capture_sys_output():
    """"""
    capture_out, capture_err = StringIO(), StringIO()
    current_out, current_err = sys.stdout, sys.stderr
    try:
        sys.stdout, sys.stderr = capture_out, capture_err
        yield capture_out, capture_err
    finally:
        sys.stdout, sys.stderr = current_out, current_err
923278
def failure(path, downloader):
    """"""
    base = os.path.basename(path)
    if sys.stdin.isatty():
        print('INFO [{}]: Failed to download {!r}'.format(downloader, base))
    else:
        notify_failure(base, downloader)
701673
def capture_output(self, with_hook=True):
        """"""
        self.hooked = ''

        def display_hook(obj):
            # That's some dirty hack
            self.hooked += self.safe_better_repr(obj)
            self.last_obj = obj

        stdout, stderr = sys.stdout, sys.stderr
        if with_hook:
            d_hook = sys.displayhook
            sys.displayhook = display_hook

        sys.stdout, sys.stderr = StringIO(), StringIO()
        out, err = [], []
        try:
            yield out, err
        finally:
            out.extend(sys.stdout.getvalue().splitlines())
            err.extend(sys.stderr.getvalue().splitlines())
            if with_hook:
                sys.displayhook = d_hook

            sys.stdout, sys.stderr = stdout, stderr
1096902
protected void printFailure(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
        if (LOGGER.isInfoEnabled(consumerConfig.getAppName())) {
            LOGGER.infoWithApp(consumerConfig.getAppName(), "Connect to {} provider:{} failure !", interfaceId,
                providerInfo);
        }
    }
1251999
def failed(self, **kwargs):
        """"""
        self.finished = datetime.now()
        self.status = 'failed'
        self.information.update(kwargs)
        self.logger.info("Failed - took %f seconds.", self.duration())
        self.update_report_collector(int(time.mktime(self.finished.timetuple())))
1363051
def error_output(self, message, method_affected=None):
        
        color_fn = self._py3_wrapper.get_config_attribute
        color = color_fn(self.module_full_name, "color_error")
        if hasattr(color, "none_setting"):
            color = color_fn(self.module_full_name, "color_bad")
        if hasattr(color, "none_setting"):
            color = None

        error = {
            "full_text": message,
            "color": color,
            "instance": self.module_inst,
            "name": self.module_name,
        }
        for method in self.methods.values():
            if method_affected and method["method"] != method_affected:
                continue

            method["last_output"] = [error]

        self.allow_config_clicks = False
        self.set_updated()
1020375
def check(self):
        
        if not self.enabled():
            return
        try:
            self.fetch()
        except (xmlrpclib.Fault, did.base.ConfigError) as error:
            log.error(error)
            self._error = True
            # Raise the exception if debugging
            if not self.options or self.options.debug:
                raise
        # Show the results stats (unless merging)
        if self.options and not self.options.merge:
            self.show()
964806
function (err, results) {
    err && console.error(err);

    results.forEach(function (result) {
        var failures = result.run.failures;

        console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
            `${result.collection.name} ran successfully.`);
    });
}
650409
def environment_failure(self, error):
        '''
        
        '''
        log.exception(
            'Failed to create environment for %s: %s',
            self.__class__.__name__, get_error_message(error)
        )
        self.shutdown(error)