mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #40333 from gtmanfred/2016.11
fix some test=True comments
This commit is contained in:
commit
2d2cb5b837
3 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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[
|
||||
|
|
|
@ -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}):
|
||||
|
|
Loading…
Add table
Reference in a new issue