fix "AttributeError: 'str' object has no attribute 'get'" and happier lint
set default for getattr
unhappy lint, happy salt.states.pkg
remove extraneous condition
Merge pull request #14715 from khrisrichardson/14426

fix "AttributeError: 'str' object has no attribute 'get'" and happy lint