summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-04 22:14:12 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-04 22:14:14 +0200
commit08235013e5c950967fc807ba9f14e408aa0c9302 (patch)
tree0c7238969fe3f15948dea5903ac61a863d9e1710 /python
parent2c6737376571959d57095dda2d967bf67feeea8f (diff)
downloadvyos-1x-08235013e5c950967fc807ba9f14e408aa0c9302.tar.gz
vyos-1x-08235013e5c950967fc807ba9f14e408aa0c9302.zip
vyos.util: rename chmod_x_file() to chmod_x()
Now both files and directories are supported.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index 781fd9a2c..c8ab43c11 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -81,11 +81,11 @@ def chown_file(path, user, group):
os.chown(path, uid, gid)
-def chmod_x_file(path):
+def chmod_x(path):
""" make file executable """
from stat import S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IXGRP, S_IROTH, S_IXOTH
- if os.path.isfile(path):
+ if os.path.exists(path):
bitmask = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | \
S_IROTH | S_IXOTH
os.chmod(path, bitmask)