mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #44160 from gtmanfred/directory
add changes to test return
This commit is contained in:
commit
304dd2529d
2 changed files with 4 additions and 2 deletions
|
@ -2258,6 +2258,7 @@ def directory(name,
|
|||
if __opts__['test']:
|
||||
ret['result'] = presult
|
||||
ret['comment'] = pcomment
|
||||
ret['changes'] = ret['pchanges']
|
||||
return ret
|
||||
|
||||
if not os.path.isdir(name):
|
||||
|
|
|
@ -792,7 +792,8 @@ class FileTestCase(TestCase):
|
|||
with patch.dict(filestate.__opts__, {'test': True}):
|
||||
comt = ('The following files will be changed:\n{0}:'
|
||||
' directory - new\n'.format(name))
|
||||
ret.update({'comment': comt, 'result': None, 'pchanges': {'/etc/grub.conf': {'directory': 'new'}}})
|
||||
ret.update({'comment': comt, 'result': None, 'pchanges': {'/etc/grub.conf': {'directory': 'new'}},
|
||||
'changes': {'/etc/grub.conf': {'directory': 'new'}}})
|
||||
self.assertDictEqual(filestate.directory(name,
|
||||
user=user,
|
||||
group=group),
|
||||
|
@ -802,7 +803,7 @@ class FileTestCase(TestCase):
|
|||
with patch.object(os.path, 'isdir', mock_f):
|
||||
comt = ('No directory to create {0} in'
|
||||
.format(name))
|
||||
ret.update({'comment': comt, 'result': False})
|
||||
ret.update({'comment': comt, 'result': False, 'changes': {}})
|
||||
self.assertDictEqual(filestate.directory
|
||||
(name, user=user, group=group),
|
||||
ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue