- I can't wrap my head around why you want to disregard the return value
of create_route_spec when invoking route_status and being configured with
"${OCF_RESKEY_object}" = "rule". Can you explain please?
I assume you're talking about this block?
---
route_status() {
route_spec=$(create_route_spec)
case ${OCF_RESKEY_object} in
rule)
route_spec=`echo "$route_spec" | sed -e 's/table/lookup/g' -e
's/\/32//g' -e 's/^\ *//'`
show_output="$(ip ${OCF_RESKEY_object} show | grep "$route_spec"
2>/dev/null)"
;;
route)
show_output="$(ip ${OCF_RESKEY_object} show $route_spec
2>/dev/null)"
;;
esac
---
The problem is that "ip rule show" won't take any arguments:
# ip rule show from 10.15.8.0/24
"ip rule show" does not take any arguments.
Moreover, when you create a rule with the "table" option, it then shows
up in the
output of "ip rule show" with the keyword "lookup", just to make things
difficult. So, if
OCF_RESKEY_object is "rule" then we rewrite the route spec to change table to
lookup, and
then run the output of "ip rule show" thru grep and use the exit status of the
grep to
validate the presence of the rule.
- what's the particular reason for not testing for [
${OCF_RESKEY_CRM_meta_clone_node_max} -eq 1 ]; does it make sense to
configure several incarnations of the same policy route on one host?
Ah, no, that's an oversight. There is no easy way to validate the
presence
of a rule, in the manner that you can test a route. That is, there is no
equivalence
of "ip link show" for a rule. The CRM test makes sense for rules, so the return
should
probably come after that. I'm not certain if the other checks make sense for a
rule, I'll
have to think about that.
- would you mind re-submitting your patch so that it applies cleanly
against the current version of Route in the Mercurial repo?
Sure! Sorry I didn't get back sooner, I have been on vacation and then
trying to catch up on things.
-poul
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/