[ClusterLabs] OCF agent validation proposal (was Re: fence_scsi no such device)

Kristoffer Grönlund kgronlund at suse.com
Tue Mar 22 08:40:28 UTC 2016


Jan Pokorný <jpokorny at redhat.com> writes:

> Hmm, I keep lamenting that by extending agents metadata with inline
> RelaxNG grammar to express co-occurrence/mutual exclusion of
> particular parameters and/or its datatype in detail, and by using
> that information at the configuration front-ends, we would push
> the overall user experience to the new level
> (https://bugzilla.redhat.com/show_bug.cgi?id=1281463#c4).

Incidentally, my plan for today was to create a submit request for
resource-agents adding a validation regex for resource parameters, just
to see if I could get a discussion going. I'd really like to see
something like this as well.

The biggest user complaint for Hawk right now is that the parameter
validation is lacking. I could add the validation data in Hawk itself,
but I'd rather have it maintained in the agent metadata.

As for RelaxNG, I'm not entirely sure about that. The benefit of having
a simple regexp string is that it's easy to make it work for example
directly in the javascript frontend, so that while configuring you can
get immediate user feedback when a parameter doesn't validate. I'd
rather not have to embed a complete XML validator in the frontend to
validate parameters that very rarely are XML. In fact, I don't know any
agent with XML parameter data. Also, looking at the RelaxNG validation
for the CIB in pacemaker, it looks awfully complicated ;)

What would the RelaxNG proposal look like, do you have an example?

There are some things that aren't expressible simply with a regular
expression per parameter, like mutual exclusion between parameters or
ranges for numbers etc. Would those be doable with a RelaxNG schema for
the metadata?

If we do go with regular expressions, I would propose sticking to the
javascript regular expression syntax [1].

[1]: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions

Cheers,
Kristoffer

>
> -- 
> Jan (Poki)
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org

-- 
// Kristoffer Grönlund
// kgronlund at suse.com




More information about the Users mailing list