Skip to content

Commit

Permalink
Merge pull request #54546 from garethgreenaway/2019_2_1_port_49843
Browse files Browse the repository at this point in the history
[master] Porting #49843 to master
  • Loading branch information
dwoz authored Nov 14, 2019
2 parents cf57c21 + c766c52 commit b9a52de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion salt/states/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6417,7 +6417,6 @@ def rename(name, source, force=False, makedirs=False):
if not force:
ret['comment'] = ('The target file "{0}" exists and will not be '
'overwritten'.format(name))
ret['result'] = False
return ret
elif not __opts__['test']:
# Remove the destination to prevent problems later
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/states/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,7 @@ def test_rename(self):
with patch.object(os.path, 'lexists', mock_lex):
comt = ('The target file "{0}" exists and will not be '
'overwritten'.format(name))
ret.update({'comment': comt, 'result': False})
ret.update({'comment': comt, 'result': True})
self.assertDictEqual(filestate.rename(name, source), ret)

mock_lex = MagicMock(side_effect=[True, True, True])
Expand Down

0 comments on commit b9a52de

Please sign in to comment.