Forum: CFEngine Help
Subject: Re: Using dist for random selections
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,24500,24523#msg-24523

It seems like perhaps using a persistent class and a transient class in 
combination would be an acceptable (perhaps even preferable) alternative to 
this.  Apply test case "a", and raise persistent class "did_a" and transient 
class "testing_a" upon keeping that promise.  If "did_a" or "testing_b" is set, 
don't do "a".  If did_a is set but testing_a and testing_b are not set, do test 
case "b", lowering persistent class did_a and raising transient class testing_b 
upon completion.  That should result in a toggle back and forth between the 
test cases for each given run of the test case generation, unless I'm not 
thinking clearly due to The Monday Morning effect. :)  A truth table or similar 
would probably be helpful if you plan to extend that scenario to more than two 
states; it's enough to keep just the three classes straight.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to