diff --git a/kiwi/utils/sync.py b/kiwi/utils/sync.py index 4ced42d6bad..2c02d2480d9 100644 --- a/kiwi/utils/sync.py +++ b/kiwi/utils/sync.py @@ -136,6 +136,9 @@ def target_supports_extended_attributes(self) -> bool: try: os.getxattr(self.target_dir, 'user.mime_type') except OSError as e: - if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA): + log.debug( + f'Check for extended attributes on {self.target_dir} said: {e}' + ) + if e.errno == errno.ENOTSUP: return False return True diff --git a/test/unit/utils/sync_test.py b/test/unit/utils/sync_test.py index 9077d4572c9..6d0ff580863 100644 --- a/test/unit/utils/sync_test.py +++ b/test/unit/utils/sync_test.py @@ -1,4 +1,5 @@ import os +import errno import logging from pytest import fixture from stat import ST_MODE @@ -66,7 +67,7 @@ def test_target_supports_extended_attributes(self, mock_getxattr): @patch('os.getxattr') def test_target_does_not_support_extended_attributes(self, mock_getxattr): - mock_getxattr.side_effect = OSError( - """[Errno 95] Operation not supported: b'/boot/efi""" - ) + effect = OSError() + effect.errno = errno.ENOTSUP + mock_getxattr.side_effect = effect assert self.sync.target_supports_extended_attributes() is False