From 8e0a54676ff2ac90b7c24e4f05b05bcebc584bd3 Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Sun, 17 Dec 2023 01:25:22 +0100 Subject: dhcp: T3316: Kea DHCP and DHCPv6 fixes * Move Kea socket permission change on-demand and speed up conf scripts * Fix issue with DHCP reservations when no `ip-address` value --- python/vyos/utils/file.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/vyos/utils/file.py') diff --git a/python/vyos/utils/file.py b/python/vyos/utils/file.py index 2af87a0ca..70ac1753b 100644 --- a/python/vyos/utils/file.py +++ b/python/vyos/utils/file.py @@ -149,6 +149,10 @@ def chmod_775(path): S_IROTH | S_IXOTH chmod(path, bitmask) +def file_permissions(path): + """ Return file permissions in string format, e.g '0755' """ + return oct(os.stat(path).st_mode)[4:] + def makedir(path, user=None, group=None): if os.path.exists(path): return -- cgit v1.2.3