[wpkg-users] New condition not working as expected

Rainer Meier r.meier at wpkg.org
Sun Oct 23 02:17:10 CEST 2011


Hi Stefan,

On 23.10.2011 01:58, Stefan Pendl wrote:
> <condition>
>      <check type="logical" condition="not">
>          <check type="host" condition="hostname" value="SATELLITE"/>
>      </check>
>      <check type="logical" condition="not">
>          <check type="host" condition="os" value="5\.0\.\d{4}"/>
>      </check>
> </condition>
>
> Now I think that the following simpler construct should give the same result, but it does not.
>
> <condition>
>      <check type="logical" condition="not">
>          <check type="host" condition="hostname" value="SATELLITE"/>
>          <check type="host" condition="os"       value="5\.0\.\d{4}"/>
>      </check>
> </condition>
>
> What do you think?

Looking at the code the logical "not" check allows only one single check 
sub-node. However the XSD allows to specify as many check sub-nodes as you want.

Well; I think I am going to extend the code to assume an implicit "and" when 
multiple sub-nodes are specified. So if any of the checks fail the result of the 
checks will be "false" and due to the "not" condition it will return "true".

Currently you should actually see an error in the log:

Check condition 'not' requires one and only one child check condition. Instead x 
childs have been found.


br,
Rainer



More information about the wpkg-users mailing list