saltstack/salt — pull request #5704 by terminalmage (2013-06-24 18:36:36+00:00)
Title: Fix case where setting file perms to 000 didn't work

Due to how Salt handles leading zeros the YAML renderer (strips them), a
value of '000' becomes '', causing tracebacks in some states, as well as
a failure to properly compare the desired mode against the actual mode
of the file. This commit normalizes modes, zero-padding them to replace
zeros removed by the YAML renderer.

It also modifies the YAML renderer to properly handle an input
consisting of all zeros, keeping it from being reduced to an empty
string.

Fixes #5613.