Merge pull request #40333 from gtmanfred/2016.11

fix some test=True comments
This commit is contained in:
Mike Place 2017-03-28 10:11:00 -06:00 committed by GitHub
commit 2d2cb5b837
3 changed files with 4 additions and 4 deletions

View file

@ -224,7 +224,7 @@ def set_(name, path):
if __opts__['test']:
ret['comment'] = (
'Alternative for {0} will be set to path {1}'
).format(name, current)
).format(name, path)
ret['result'] = None
return ret
__salt__['alternatives.set'](name, path)

View file

@ -142,9 +142,9 @@ def _absent_test(user, name, enc, comment, options, source, config):
if keys:
comment = ''
for key, status in list(keys.items()):
if status == 'exists':
if status == 'add':
continue
comment += 'Set to {0}: {1}\n'.format(status, key)
comment += 'Set to remove: {0}\n'.format(key)
if comment:
return result, comment
err = sys.modules[

View file

@ -199,7 +199,7 @@ class AlternativesTestCase(TestCase):
ret.update({'comment': comt})
self.assertDictEqual(alternatives.set_(name, path), ret)
comt = ('Alternative for {0} will be set to path False'
comt = ('Alternative for {0} will be set to path /usr/bin/less'
).format(name)
ret.update({'comment': comt, 'result': None})
with patch.dict(alternatives.__opts__, {'test': True}):