summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-27 23:29:14 +0100
committerChristian Poessinger <christian@poessinger.com>2019-10-27 23:57:10 +0100
commitebcb19b5b9a1ae57b3b0f902d6fb0259fe2ed209 (patch)
tree4c688418fc69915e2193d51068c16c80695254d9 /src/conf_mode
parent7021b97dad29d2e2509a0f5b7024eb506d04b62b (diff)
downloadvyos-1x-ebcb19b5b9a1ae57b3b0f902d6fb0259fe2ed209.tar.gz
vyos-1x-ebcb19b5b9a1ae57b3b0f902d6fb0259fe2ed209.zip
snmp: use proper stat literals on chmod()
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/snmp.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py
index f796e9978..a8c604bdd 100755
--- a/src/conf_mode/snmp.py
+++ b/src/conf_mode/snmp.py
@@ -27,6 +27,7 @@ import vyos.validate
from binascii import hexlify
from shutil import move
from time import sleep
+from stat import S_IRWXU,S_IXGRP,S_IXOTH
from vyos.config import Config
from vyos import ConfigError
@@ -545,9 +546,9 @@ def verify(snmp):
if snmp['script_ext']:
for ext in snmp['script_ext']:
if not os.path.isfile(snmp['script_ext'][ext]):
- print ("WARNING: script: " + snmp['script_ext'][ext] + " doesn\'t exist")
+ print ("WARNING: script: {} doesn't exist".format(snmp['script_ext'][ext]))
else:
- os.chmod(snmp['script_ext'][ext], 0o555)
+ os.chmod(snmp['script_ext'][ext], S_IRWXU|S_IXGRP|S_IXOTH)
for listen in snmp['listen_address']:
addr = listen[0]