[Pacemaker] RFC: Compacting constraints

Lars Marowsky-Bree lmb at suse.de
Wed Nov 11 13:49:22 UTC 2009


On 2009-11-06T22:13:32, Colin <colin.hch at gmail.com> wrote:

> > conjoin dummies-dep base-clone {dummy1, dummy2, dummy3, ...} \
> >        meta score_collocation=infinity score_order=0
> 
> Suppose we allow regular expressions:
> 
> order dummy(\d+)-o 0: base-clone dummy#1
> 
> (Where \d is a digit, and #1 inserts the string that matched the first
> bracketed sub-regular-expression from the "other" resource name...
> 
> Just thinking out loud, regexes could make so many things shorter...

Woah, you've just officially scared me. ;-)

The problem with your example of course is that it is not clear what to
iterate over. In the above, there's no dummy\d+-o to match yet; in fact,
that is what you'd want to create. So in theory, you'd want this the
other way around - match on the dummy\d+ resource reference and expand
the order constraint from that, which doesn't work well with XML. So, I
think the expansion is right out, because this would never be gotten
right.

If you're saying to allow regex - or at least basic shell pattern -
matching in a resource reference, say a resource set - where actually
each set expands to many resources anyway, now that would possibly be a
clean syntax extension.

ie:

order dummy-o: base-clone (dummy[0-9]+)


Regards,
    Lars

-- 
Architect Storage/HA, OPS Engineering, Novell, Inc.
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde





More information about the Pacemaker mailing list