def update_inplace_risk(self, scanning_progress, rule, res): """Function updates inplace risk""" inplace_risk = xccdf.get_check_import_inplace_risk(rule) if inplace_risk: return_value = xccdf.get_and_print_inplace_risk(0, inplace_risk) if int(return_value) < 3: res.text = utils.get_needs_inspection() elif int(return_value) == 3: res.text = utils.get_needs_action() for index, row in enumerate(scanning_progress.output_data): if self.get_nodes_text(rule, "title") in row: scanning_progress.output_data[index] = "{0}:{1}".format( self.get_nodes_text(rule, "title"), res.text)
def upd_inspection(rule): """ Function updates result to needs_action in case of NONE, SLIGHT or MEDIUM risk """ return rule.get("idref"), utils.get_needs_inspection()