mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Python3 fixes and porting (#17271)
* Fix to_native call in selinux_context and selinux_default_context to use the error handler correctly. * Port set_mode_if_different to work on python3 * Port atomic_move to work on python3 * Fix check_password_prompt variable which wasn't renamed properly
This commit is contained in:
@@ -68,7 +68,7 @@ def _check_mode_changed_to_0660(self, mode):
|
||||
with patch('os.lstat', side_effect=[self.mock_stat1, self.mock_stat2, self.mock_stat2]) as m_lstat:
|
||||
with patch('os.lchmod', return_value=None, create=True) as m_lchmod:
|
||||
self.assertEqual(self.am.set_mode_if_different('/path/to/file', mode, False), True)
|
||||
m_lchmod.assert_called_with('/path/to/file', 0o660)
|
||||
m_lchmod.assert_called_with(b'/path/to/file', 0o660)
|
||||
|
||||
def _check_mode_unchanged_when_already_0660(self, mode):
|
||||
# Note: This is for checking that all the different ways of specifying
|
||||
|
||||
Reference in New Issue
Block a user