Forum: Cfengine Help Subject: Re: Turning on multiple classes on a file copy? Author: jgreer Link to topic: https://cfengine.com/forum/read.php?3,20803,20817#msg-20817
Mark, Thanks. I have defined my own if_repaired body - it's the same as the one in the stdlib, and it works using the code I posted. Can you give me an example of passing multiple classes directly to if_repaired (rather than by variable name)? I've tried several approaches, all of which result in syntax errors. Results from my testing: ------------- classes => if_repaired( "@(cloudmark_conf_changed)" ), --- WORKS ------------- classes => if_repaired( "ldconfig_change", "mimedefang_restart" ), -- SYNTAX ERROR: !! Argument mismatch in body template give[+args] = 2, take[-args] = 1 Number of arguments does not match for body reference "if_repaired" in promise at line 116 of /var/cfengine/inputs/dcsunix/omr.cf -------------- classes => if_repaired( "{ "ldconfig_change", "mimedefang_restart" }" ), -- SYNTAX ERROR: community>:/var/cfengine/inputs/dcsunix/omr.cf:118,52: syntax error, near token 'ldconfig_change' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,56: Something defined outside of a block or missing punctuation in input, near token ', "' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,56: syntax error, near token ', "' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,74: Something defined outside of a block or missing punctuation in input, near token 'mimedefang_restart' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,74: syntax error, near token 'mimedefang_restart' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,78: Something defined outside of a block or missing punctuation in input, near token ' }"' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,78: syntax error, near token ' }"' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,81: Something defined outside of a block or missing punctuation in input, near token ')' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,81: syntax error, near token ')' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,82: Something defined outside of a block or missing punctuation in input, near token ',' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,82: syntax error, near token ',' ------------- classes => if_repaired( { "ldconfig_change", "mimedefang_restart" } ), -- SYNTAX ERROR: community>:/var/cfengine/inputs/dcsunix/omr.cf:118,34: syntax error, near token '{' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,52: Something defined outside of a block or missing punctuation in input, near token 'ldconfig_change"' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,52: syntax error, near token 'ldconfig_change"' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,53: Something defined outside of a block or missing punctuation in input, near token ',' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,53: syntax error, near token ',' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,74: Something defined outside of a block or missing punctuation in input, near token 'mimedefang_restart"' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,74: syntax error, near token 'mimedefang_restart"' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,76: Something defined outside of a block or missing punctuation in input, near token '}' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,76: syntax error, near token '}' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,78: Something defined outside of a block or missing punctuation in input, near token ')' community>:/var/cfengine/inputs/dcsunix/omr.cf:118,78: syntax error, near token ')' -- Jessica _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine