<div dir="ltr"><div>Many Thanks Thierry.<br><br></div><div>I figured out that the same applies for PathFilter with the "pass" parameter. A rule containing a "pass" parameter means your command needs to have this parameter no mater how it looks like.<br>

</div><div><br></div><div>Your advice with a second rule which is named differently works fine.<br><br></div><div>Many Thanks,<br><br>Kai</div><div><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

2014-07-09 11:34 GMT+02:00 Thierry Carrez <span dir="ltr"><<a href="mailto:thierry@openstack.org" target="_blank">thierry@openstack.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5">Kai Brennenstuhl wrote:<br>
> I want to create a RegExpFilter (in nova/rootwrap.d) where the last<br>
> parameter is optional.<br>
> I can create a filter so that it works either with the last parameter or<br>
> without.<br>
> But I don't know how the rule has to look like so that the last<br>
> parameter is optional.<br>
><br>
> Following is in my *.filters file:<br>
><br>
> mycmd: RegExpFilter, /usr/local/bin/mycmd, root, mycmd, either|or,<br>
> anotherparam, .*<br>
> if I use the rule above there must be a 3rd parameter (no matter how it<br>
> looks like)<br>
><br>
> However if I use the following I can't call  "mycmd" with a 3rd parameter<br>
> mycmd: RegExpFilter, /usr/local/bin/mycmd, root, mycmd, either|or,<br>
> anotherparam<br>
><br>
> If I use both rules the first one is ignored.<br>
><br>
> What should I change to have a rule with an optional parameter?<br>
<br>
</div></div>RegExpFilter checks the number of parameters, so if you want to leverage<br>
RegExpFilter with an optional parameter you will have to write two<br>
separate rules.<br>
<br>
They have to be named differently though (mcmd1 and mycmd2 for example),<br>
otherwise the second one overwrites the first one.<br>
<br>
Regards,<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Thierry Carrez (ttx)<br>
<br>
_______________________________________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
Post to     : <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
</font></span></blockquote></div><br></div>