Skip to content

Commit

Permalink
fixup! traverser
Browse files Browse the repository at this point in the history
  • Loading branch information
milroy committed Jan 14, 2025
1 parent e248f48 commit a9db15c
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion resource/traversers/dfu_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@ int dfu_impl_t::find (std::shared_ptr<match_writers_t> &writers, const std::stri
vtx_predicates_override_t p_overridden;
bool agfilter = false;
uint64_t jobid = 0;
std::vector<std::pair<std::string, std::string>> predicates;

if (!m_match || !m_graph || !m_graph_db || !writers) {
errno = EINVAL;
Expand All @@ -1246,11 +1247,30 @@ int dfu_impl_t::find (std::shared_ptr<match_writers_t> &writers, const std::stri
m_err_msg += ": invalid criteria: " + criteria + ".\n";
goto done;
}
if ((rc = m_expr_eval.extract (criteria, target, jobid, agfilter)) < 0) {
if ((rc = m_expr_eval.extract (criteria, target, predicates)) < 0) {
m_err_msg += __FUNCTION__;
m_err_msg += ": failed extraction.\n";
goto done;
}
for (auto const &p : predicates) {
if (p.first == "jobid-alloc" || p.first == "jobid-span" || p.first == "jobid-tag" || p.first == "jobid-reserved") {
try {
jobid = std::stoul (p.second);
} catch (std::invalid_argument) {
errno = EINVAL;
goto done;
} catch (std::out_of_range) {
errno = EINVAL;
goto done;
}
} else if (p.first == "agfilter") {
if (p.second == "true" || p.second == "t") {
agfilter = true;
} else {
agfilter = false;
}
}
}

tick ();

Expand Down

0 comments on commit a9db15c

Please sign in to comment.