Update state.py

https://github.com/saltstack/salt/issues/7991
https://github.com/saltstack/salt/issues/7903