onbeep-cookbooks/ssl-vault — pull request #2 by bkw (2014-09-04 06:37:18+00:00)
Title: fix data_bag_key_rex for chef 11

This one took a long time to track down, in fact chef inc support did it, thanks and kudos to Josh Glass for the detective work.

While the data_bag_key_rex regexp is legal, the backslash is incorrectly converted to json by the chef client resulting in invalid json while saving the attributes back to the server. The server would then reject the data with a 400 Bad Request Error, making the whole chef run fail.

This PR moves the dash to the end of the character class, eliminating the need to escape it. Not only makes it the regex more readable while preserving original identical function, it also circumvents the bug.