puppetlabs/puppetlabs-stdlib — pull request #113 by raphink (2012-12-06 12:14:58+00:00)
Title: Add validate_cmd function

This PR adds a new `validate_cmd` function, which takes a string and a command, and validates the string against the command. Example:

validate_cmd("root ALL=(ALL) ALL\n", "/usr/sbin/visudo -c -f")

Like all `validate_*` functions, it fails compilation if the check fails. It also takes an optional 3rd argument to specify a nicer message.