Skip to content

Commit

Permalink
Merge branch 'master' into isbm-func-static
Browse files Browse the repository at this point in the history
  • Loading branch information
isbm authored Oct 30, 2024
2 parents 033fc6c + babe2f1 commit f38f8f7
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions libsysinspect/src/intp/actproc/modfinder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,18 @@ impl ModCall {
}

for exp in exp {
let fact = functions::get_by_namespace(resp.data(), &exp.get_fact_namespace());
let res = exp.eval(fact.to_owned());
if !res.is_positive() {
let mut traces: Vec<String> =
vec![format!("{} fails with {}", &exp.get_fact_namespace(), dataconv::to_string(fact).unwrap_or_default())];
traces.extend(res.traces().to_owned());
return (Some(false), Some(traces));
let fact = Expression::get_by_namespace(resp.data(), &exp.get_fact_namespace());
if !exp.eval(fact.to_owned()) {
let fact = dataconv::to_string(fact).unwrap_or_default();
return (
Some(false),
Some(format!(
"{} fact {}{}",
&exp.get_fact_namespace(),
if fact.is_empty() { "data was not found" } else { "fails as " },
fact
)),
);
}
}

Expand Down

0 comments on commit f38f8f7

Please sign in to comment.