Back-port #36714 to 2016.11 (#39133)
Back-port #36714 to 2016.11 (#39133)

* Fix: local variable result referenced before assignment

* Fix: if 'path' variable is None convert it into an empty string

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