summaryrefslogtreecommitdiff
path: root/python/vyos/utils
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2023-12-17 01:25:22 +0100
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2023-12-17 01:39:26 +0100
commit8e0a54676ff2ac90b7c24e4f05b05bcebc584bd3 (patch)
treecded61e59bb7a936d299ab3a8518ca80577a77d8 /python/vyos/utils
parent03202504d559417266e437bbf53eb26ade187c07 (diff)
downloadvyos-1x-8e0a54676ff2ac90b7c24e4f05b05bcebc584bd3.tar.gz
vyos-1x-8e0a54676ff2ac90b7c24e4f05b05bcebc584bd3.zip
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
Diffstat (limited to 'python/vyos/utils')
-rw-r--r--python/vyos/utils/file.py4
1 files changed, 4 insertions, 0 deletions
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