HomeClusterLabs Projects

Fix: libcrmcommon: Rewrite much of parse_op_key.

Description

Fix: libcrmcommon: Rewrite much of parse_op_key.

This function has problems with most operation names that have an
underscore in them, like "migrate_to" or "migrate_from". It parses
those as if the "migrate" is part of the resource name, and "to" or
"from" is the operation name. It does appear to understand _post_notify
and _pre_notify operations, at least.

I've rewritten much of the function to also understand "migrate_to" and
"migrate_from". This is done with a hybrid method. First, the various
operations with an underscore in the name are looked for with a regular
expression. If that fails, we grab the operation and resource by
splitting on underscores.

Additional operation names can be added to the regex if needed.

I'm hoping the rewritten version is a little easier to follow. I have
added a lot of comments to make it easier understand when it needs to be
debugged. There are also test cases.

Details

Provenance
clumensAuthored on Sep 24 2020, 4:51 PM
Parents
rP031273997805: Merge pull request #2181 from oalbrigt/test-ocf_degraded-remap-ocf_ok
Branches
Unknown
Tags
Unknown

Event Timeline