Gets the result of the bios settings applied

        :raises: IloError, on an error from iLO.
        :raises: IloCommandNotSupportedError, if the command is
                 not supported on the server.
176485
def get_bios_settings_result(self):
        
        sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
        try:
            settings_result = sushy_system.bios_settings.messages
        except sushy.exceptions.SushyError as e:
            msg = (self._('The BIOS Settings results were not found. Error '
                          '%(error)s') %
                   {'error': str(e)})
            LOG.debug(msg)
            raise exception.IloError(msg)
        status = "failed" if len(settings_result) > 1 else "success"
        return {"status": status, "results": settings_result}
1150551
def get_result_from_execution(self, id_execution, access_token=None, user_id=None):
        
        if access_token:
            self.req.credential.set_token(access_token)
        if user_id:
            self.req.credential.set_user_id(user_id)
        if not self.check_credentials():
            raise CredentialsError('credentials invalid')
        execution = self.req.get('/Executions/' + id_execution)
        result = {}
        if "result" in execution and "data" in execution["result"]:
            if execution["result"]["data"].get('p', None):
                result["measure"] = execution["result"]["data"]["p"]
            if execution["result"]["data"].get('valsxyz', None):
                result["bloch"] = execution["result"]["data"]["valsxyz"]
            if "additionalData" in execution["result"]["data"]:
                ad_aux = execution["result"]["data"]["additionalData"]
                result["extraInfo"] = ad_aux
            if "calibration" in execution:
                result["calibration"] = execution["calibration"]
            if execution["result"]["data"].get('cregLabels', None):
                result["creg_labels"] = execution["result"]["data"]["cregLabels"]
            if execution["result"]["data"].get('time', None):
                result["time_taken"] = execution["result"]["data"]["time"]

        return result
1258469
def parse_result(self, data):
        
        # typedef struct {
        #   YSM_STATUS status;                  // Unlock status
        # } YSM_KEY_STORAGE_UNLOCK_RESP;
        fmt = "B"
        self.status, = struct.unpack(fmt, data)

        if self.status == pyhsm.defines.YSM_STATUS_OK:
            return True
        else:
            raise pyhsm.exception.YHSM_CommandFailed(pyhsm.defines.cmd2str(self.command), self.status)
1041427
def get_bios_dhcp
      response = rest_get('/redfish/v1/Systems/1/bios/Settings/')
      bios = response_handler(response)
      {
        'Dhcpv4' => bios['Dhcpv4'],
        'Ipv4Address' => bios['Ipv4Address'],
        'Ipv4Gateway' => bios['Ipv4Gateway'],
        'Ipv4PrimaryDNS' => bios['Ipv4PrimaryDNS'],
        'Ipv4SecondaryDNS' => bios['Ipv4SecondaryDNS'],
        'Ipv4SubnetMask' => bios['Ipv4SubnetMask']
      }
    end
533650
def RaiseIfNotErrorSuccess(result, func = None, arguments = ()):
    
    if result != ERROR_SUCCESS:
        raise ctypes.WinError(result)
    return result
618342
def execute_lite(self, instructions, context=None):
        
        if context:
            self.__cpu.registers = dict(context)

        for instr in instructions:
            self.__execute_one(instr)

        return dict(self.__cpu.registers), self.__mem
624792
def get_bios_settings(irmc_info):
    

    bios_config = backup_bios_config(irmc_info)['bios_config']
    bios_config_data = bios_config['Server']['SystemConfig']['BiosConfig']
    settings = []

    # TODO(trungnv): Allow working with multi levels of BIOS dictionary.
    for setting_param in BIOS_CONFIGURATION_DICTIONARY:
        type_config, config = BIOS_CONFIGURATION_DICTIONARY[
            setting_param].split("_")
        if config in bios_config_data.get(type_config, {}):
            value = six.text_type(bios_config_data[type_config][config])
            settings.append({'name': setting_param, 'value': value})
    return settings
1174263
def check_command(self, op_description, op=None, data=b'', chk=0, timeout=DEFAULT_TIMEOUT):
        
        val, data = self.command(op, data, chk, timeout=timeout)

        # things are a bit weird here, bear with us

        # the status bytes are the last 2/4 bytes in the data (depending on chip)
        if len(data) < self.STATUS_BYTES_LENGTH:
            raise FatalError("Failed to %s. Only got %d byte status response." % (op_description, len(data)))
        status_bytes = data[-self.STATUS_BYTES_LENGTH:]
        # we only care if the first one is non-zero. If it is, the second byte is a reason.
        if byte(status_bytes, 0) != 0:
            raise FatalError.WithResult('Failed to %s' % op_description, status_bytes)

        # if we had more data than just the status bytes, return it as the result
        # (this is used by the md5sum command, maybe other commands?)
        if len(data) > self.STATUS_BYTES_LENGTH:
            return data[:-self.STATUS_BYTES_LENGTH]
        else:  # otherwise, just return the 'val' field which comes from the reply header (this is used by read_reg)
            return val
24648
def get_settings(*args)
      SafeIndex.log_or_throw(:get_settings, @raise_on_failure) do
        begin
          @index.get_settings(*args)
        rescue Algolia::AlgoliaError => e
          return {} if e.code == 404 # not fatal
          raise e
        end
      end
    end
477234
def _read_result(self, num_retries):
        ''''''
        for i in range(num_retries):
            self._assert_alive()
            try:
                return self._result_channel.get()
            except IOError as ex:
                if ex.errno == 4:
                    # errno=4 corresponds to "System call interrupted",
                    # which means a signal was recieved before any data
                    # was sent. For now I think it's safe to ignore this
                    # and continue.
                    logger.exception('attempt to read from channel was interrupted by something')
                    sys.exc_clear()
                else:
                    # Something else went wrong - raise the exception as usual
                    raise ex

        raise ChannelError('failed to read from channel after %d retries' % num_retries)
1073635
def _change_iscsi_settings(self, iscsi_info):
        
        headers, bios_uri, bios_settings = self._check_bios_resource()
        # Get the Mappings resource.
        map_settings = self._get_bios_mappings_resource(bios_settings)
        nics = []
        for mapping in map_settings['BiosPciSettingsMappings']:
            for subinstance in mapping['Subinstances']:
                for association in subinstance['Associations']:
                    if 'NicBoot' in association:
                        nics.append(association)

        if not nics:
            msg = ('No nics found')
            raise exception.IloError(msg)

        iscsi_uri = self._check_iscsi_rest_patch_allowed()
        # Set iSCSI info to all nics
        iscsi_infos = []
        for nic in nics:
            data = iscsi_info.copy()
            data['iSCSIBootAttemptName'] = nic
            data['iSCSINicSource'] = nic
            data['iSCSIBootAttemptInstance'] = nics.index(nic) + 1
            iscsi_infos.append(data)

        patch_data = {'iSCSIBootSources': iscsi_infos}
        status, headers, response = self._rest_patch(iscsi_uri,
                                                     None, patch_data)
        if status >= 300:
            msg = self._get_extended_error(response)
            raise exception.IloError(msg)
619756
def _onerror(self, result):
        
        if KSER_METRICS_ENABLED == "yes":
            KSER_TASKS_STATUS.labels(
                __hostname__, self.__class__.path, 'FAILED'
            ).inc()

        if result:
            result = self.result + result
        else:
            result = self.result
        logger.error(
            "{}.Failed: {}[{}]: {}".format(
                self.__class__.__name__, self.__class__.path, self.uuid, result
            ),
            extra=dict(
                kmsg=Message(
                    self.uuid, entrypoint=self.__class__.path,
                    params=self.params, metadata=self.metadata
                ).dump(),
                kresult=ResultSchema().dump(result) if result else dict()
            )
        )
        return self.onerror(result)
795597
def raise_check_result(self):
        
        if not self.__class__.log_active_checks:
            return

        log_level = 'info'
        if self.state in [u'WARNING', u'UNREACHABLE']:
            log_level = 'warning'
        elif self.state == u'CRITICAL':
            log_level = 'error'
        brok = make_monitoring_log(
            log_level, 'ACTIVE SERVICE CHECK: %s;%s;%s;%d;%s' % (self.host_name, self.get_name(),
                                                                 self.state, self.attempt,
                                                                 self.output)
        )
        self.broks.append(brok)
88619
def do_execute(self):
        
        result = None
        evl = self.input.payload
        pltclassifier.plot_classifier_errors(
            evl.predictions,
            absolute=bool(self.resolve_option("absolute")),
            max_relative_size=int(self.resolve_option("max_relative_size")),
            absolute_size=int(self.resolve_option("absolute_size")),
            title=self.resolve_option("title"),
            outfile=self.resolve_option("outfile"),
            wait=bool(self.resolve_option("wait")))
        return result
329111
def check_output_and_strip(cmd):  # type: (List[Text]) -> Optional[Text]
    
    try:
        result = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
        return result.strip()
    except (OSError, subprocess.CalledProcessError, TypeError, AttributeError):
        # OSError is raised if command doesn't exist
        # CalledProcessError is raised if command returns nonzero
        # AttributeError is raised if result cannot be strip()ped
        return None
82416
def execute_get_text(command, raise_errors=False):  # type: (str, bool) -> str
    
    try:
        result = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
        # print(result.decode())
    except subprocess.CalledProcessError:
        if raise_errors:
            raise
        return ""
    if result:
        return result.decode("utf-8")
    return ""
777201
function(bin) {
    var binSettings = {};

    // self defence against muppertary
    if (typeof bin.settings === 'string') {
      try {
        binSettings = JSON.parse(bin.settings);
      } catch (e) {}
    } else {
      binSettings = bin.settings;
    }

    if (
      binSettings &&
      binSettings.processors &&
      Object.keys(binSettings.processors).length
    ) {
      return Promise.all(
        Object.keys(binSettings.processors).map(function(panel) {
          var processorName = binSettings.processors[panel],
            code = bin[panel];
          if (processors.support(processorName)) {
            bin['original_' + panel] = code;
            return processors
              .run(processorName, {
                source: code,
                url: bin.url,
                revision: bin.revision,
              })
              .then(function(output) {
                var result = '';
                if (output.result) {
                  result = output.result;
                } else {
                  result = output.errors
                    .map(function(error) {
                      return (
                        'Line: ' +
                        error.line +
                        '\nCharacter: ' +
                        error.ch +
                        '\nMessage: ' +
                        error.msg
                      );
                    })
                    .join('\n\n');
                }
                bin[panel] = result;
                return bin;
              })
              .catch(function() {
                return bin;
              });
          } else {
            return Promise.resolve(bin);
          }
        })
      );
    }

    // otherwise default to being resolved
    return Promise.resolve([bin]);
  }