summaryrefslogtreecommitdiff
path: root/python/vyos/utils
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-12-17 08:14:05 +0100
committerGitHub <noreply@github.com>2023-12-17 08:14:05 +0100
commit55e10e3b5962ccbc52400392c383c15417d46f35 (patch)
treecded61e59bb7a936d299ab3a8518ca80577a77d8 /python/vyos/utils
parent03202504d559417266e437bbf53eb26ade187c07 (diff)
parent8e0a54676ff2ac90b7c24e4f05b05bcebc584bd3 (diff)
downloadvyos-1x-55e10e3b5962ccbc52400392c383c15417d46f35.tar.gz
vyos-1x-55e10e3b5962ccbc52400392c383c15417d46f35.zip
Merge pull request #2646 from sarthurdev/kea_fixes
dhcp: T3316: Kea DHCP and DHCPv6 fixes
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