Modify log message when checking file permissions
Removed code to display it in octal since it makes no sense on Windows. Added `oct()` around linux permissions when expected_permissions is being defined.
This commit is contained in:
parent
424aceb116
commit
91aad66e16
|
@ -26,9 +26,9 @@ def _raise_if_incorrect_permissions(
|
||||||
f: str, linux_expected_permissions: int, windows_expected_permissions: int
|
f: str, linux_expected_permissions: int, windows_expected_permissions: int
|
||||||
):
|
):
|
||||||
expected_permissions = (
|
expected_permissions = (
|
||||||
windows_expected_permissions if is_windows_os() else linux_expected_permissions
|
windows_expected_permissions if is_windows_os() else oct(linux_expected_permissions)
|
||||||
)
|
)
|
||||||
if not has_expected_permissions(f, expected_permissions):
|
if not has_expected_permissions(f, expected_permissions):
|
||||||
raise InsecurePermissionsError(
|
raise InsecurePermissionsError(
|
||||||
f"The file {f} has incorrect permissions. Expected: {oct(expected_permissions)}"
|
f"The file {f} has incorrect permissions. Expected: {expected_permissions}"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue