saltstack/salt — pull request #4299 by jsdalton (2013-03-27 17:36:26+00:00)
Title: Coerce output of file.get_mode to string

This is a quick fix for #4286. In the `file.check_perms` it's trying to call the `lstrip` method on the return value from `file.get_mode`, which could be an integer. When an integer is returned this throws an AttributeError.

Looking at the module, I found this bit of code a few lines up (1226):

```python
perms['lmode'] = str(__salt__['file.get_mode'](name)).lstrip('0')
```

There, the return value of get_mode is being correctly coerced to a string.

As a quick fix, I just applied the same fix to the line that was causing a problem.

(Normally, I'd write a test, but there were no tests for `check_perms()` and the fix was straightforward, so this seemed like the most expedient solution.)