Normalize the mode before we compare it.

This commit is contained in:
Gareth J. Greenaway 2018-07-02 09:06:22 -07:00
parent 08ad5665de
commit 2454652914
No known key found for this signature in database
GPG Key ID: 10B62F8A7CAD7A41

View File

@ -2294,7 +2294,11 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin):
# Check that the owner and group are correct, and
# the mode is what we expect
temp_file_stats = os.stat(tempfile)
# Normalize the mode
temp_file_mode = six.text_type(oct(stat.S_IMODE(temp_file_stats.st_mode)))
temp_file_mode = salt.utils.files.normalize_mode(temp_file_mode)
self.assertEqual(temp_file_mode, '4750')
self.assertEqual(pwd.getpwuid(temp_file_stats.st_uid).pw_name, user)
self.assertEqual(grp.getgrgid(temp_file_stats.st_gid).gr_name, group)