Fix "IndexError: list index out of range"
Fix "IndexError: list index out of range"

When running Python 2.7, an empty list will throw an "IndexError: list index out of range" error. We must check if the list is not empty before trying to iterate over it.

(backport https://github.com/bbinet/pillarstack/commit/91319cb4e1fe676c94dae2e77fea914f5d4335c2)

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt