Only force saltenv/pillarenv to be a string when not None

This fixes a regression introduced to make numeric saltenv/pillarenv
work properly.
This commit is contained in:
Erik Johnson 2017-07-20 13:55:06 -05:00
parent 81695a9f3c
commit 17f347123a

View File

@ -264,14 +264,14 @@ def _get_opts(**kwargs):
if 'saltenv' in kwargs:
saltenv = kwargs['saltenv']
if not isinstance(saltenv, six.string_types):
if saltenv is not None and not isinstance(saltenv, six.string_types):
opts['environment'] = str(kwargs['saltenv'])
else:
opts['environment'] = kwargs['saltenv']
if 'pillarenv' in kwargs:
pillarenv = kwargs['pillarenv']
if not isinstance(pillarenv, six.string_types):
if pillarenv is not None and not isinstance(pillarenv, six.string_types):
opts['pillarenv'] = str(kwargs['pillarenv'])
else:
opts['pillarenv'] = kwargs['pillarenv']